From: VMware, Inc <> Date: Thu, 17 Jun 2010 21:56:08 +0000 (-0700) Subject: Soft power ops: changes for Mac OS X support. X-Git-Tag: 2010.06.16-268169~78 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=953067574ba70f3571b2dddfd4375bfbeba395d3;p=thirdparty%2Fopen-vm-tools.git Soft power ops: changes for Mac OS X support. Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/lib/guestApp/guestApp.c b/open-vm-tools/lib/guestApp/guestApp.c index 5c04f13ba..ce06591df 100644 --- a/open-vm-tools/lib/guestApp/guestApp.c +++ b/open-vm-tools/lib/guestApp/guestApp.c @@ -66,14 +66,14 @@ extern "C" { * 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(_WIN32) -#define GUESTAPP_TOOLS_INSTALL_PATH "" +#if defined _WIN32 +# define GUESTAPP_TOOLS_INSTALL_PATH "" +#elif defined __APPLE__ +# define GUESTAPP_TOOLS_INSTALL_PATH "/Library/Application Support/VMware Tools" #else -#define GUESTAPP_TOOLS_INSTALL_PATH "/etc/vmware-tools" +# define GUESTAPP_TOOLS_INSTALL_PATH "/etc/vmware-tools" #endif /* diff --git a/open-vm-tools/scripts/common/statechange.sh b/open-vm-tools/scripts/common/statechange.sh index 8897a61ec..d5840caa3 100644 --- a/open-vm-tools/scripts/common/statechange.sh +++ b/open-vm-tools/scripts/common/statechange.sh @@ -30,13 +30,13 @@ # in other words, `basename "$0"` might be poweron-vm-default. # # Handy reference/shorthand used in this doc/scripts: -# toolsConfDir ::= Depends on platform and installation settings. Likely +# TOOLS_CONFDIR ::= Depends on platform and installation settings. Likely # "/etc/vmware-tools" or # "/Library/Application Support/VMware Tools" # powerOp ::= One of "poweron-vm", "poweroff-vm", "suspend-vm", and # "resume-vm". -# vmwScriptDir ::= $toolsConfDir/scripts/vmware -# userScriptDir ::= $toolsConfDir/scripts/${powerOp}-default.d +# vmwScriptDir ::= $TOOLS_CONFDIR/scripts/vmware +# userScriptDir ::= $TOOLS_CONFDIR/scripts/${powerOp}-default.d # # End users may install scripts of their own under $userScriptDir. They # are executed in alphabetical order with "$powerOp" as the only argument. @@ -67,10 +67,11 @@ echo `date` ": Executing '$0'" # See above. -toolsConfDir=`dirname "$0"` +TOOLS_CONFDIR=`dirname "$0"` +export TOOLS_CONFDIR # Pull in subroutines like Panic. -. "$toolsConfDir"/statechange.subr +. "$TOOLS_CONFDIR"/statechange.subr # @@ -110,8 +111,8 @@ main() { powerOp=`basename "$0" | sed 's,-default,,'` exitCode=0 - vmwScriptDir="$toolsConfDir/scripts/vmware" - userScriptDir="$toolsConfDir/scripts/${powerOp}-default.d" + vmwScriptDir="$TOOLS_CONFDIR/scripts/vmware" + userScriptDir="$TOOLS_CONFDIR/scripts/${powerOp}-default.d" case "$powerOp" in poweron-vm|resume-vm)