Skip to content

Commit

Permalink
Add unix-style shell support for Windows
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//dev/coherence-ce/main/": change = 78407]
  • Loading branch information
fryp committed May 4, 2020
1 parent 08f33ea commit b27df87
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
1 change: 1 addition & 0 deletions bin/cfgcommon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ function setup
if [ -z $JAVA_HOME ] || [ "$($JAVA_HOME/bin/java -version 2>&1 | sed 's/.*version "\([0-9]*\).*/\1/; 1q')" != "$_VERSION_REQUIRED" ]; then
# Try to find the correct version
JAVA_HOME=`eval $_JAVA_HOME_CMD`
echo JAVA_HOME evaluated to $JAVA_HOME

unset _ERROR

Expand Down
3 changes: 3 additions & 0 deletions bin/cfglocal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ case $(uname) in
SunOS*)
. $SCRIPTS_DIR/cfgsolaris.sh
;;
Windows*)
. $SCRIPTS_DIR/cfgwindows.sh
;;
*)
. $SCRIPTS_DIR/cfglinux.sh
;;
Expand Down
54 changes: 54 additions & 0 deletions bin/cfgwindows.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/bin/bash

#
# Copyright (c) 2000, 2020, Oracle and/or its affiliates.
#
# Licensed under the Universal Permissive License v 1.0 as shown at
# http://oss.oracle.com/licenses/upl.
#

#
# This script sets all environment variables necessary to build Coherence.
#
# Command line:
# . ./cfgwindows.sh [-reset]
#
# see cfgcommon.sh

#
# Global Variables
#

# The platform specific command used to locate the correct version of java
# Note: this command is evaluated when required
_JAVA_HOME_CMD="get_java_home"

function get_java_home
{
echo Not Supported
}

# determine the scripts directory, assuming all scripts are in the same directory
SCRIPT_PATH="${BASH_SOURCE[0]}"
while [ -h "${SCRIPT_PATH}" ]; do
LS=`ls -ld "${SCRIPT_PATH}"`
LINK=`expr "${LS}" : '.*-> \(.*\)$'`
if [ `expr "${LINK}" : '/.*'` > /dev/null ]; then
SCRIPT_PATH="${LINK}"
else
SCRIPT_PATH="`dirname "${SCRIPT_PATH}"`/${LINK}"
fi
done

cd `dirname $SCRIPT_PATH`
SCRIPTS_DIR=`pwd`
cd - &>/dev/null

if [ -f $SCRIPTS_DIR/../tools/internal/bin/cfgwindows.sh ]; then
source $SCRIPTS_DIR/../tools/internal/bin/cfgwindows.sh
fi

source $SCRIPTS_DIR/cfgcommon.sh

unset SCRIPT_PATH
unset SCRIPTS_DIR

0 comments on commit b27df87

Please sign in to comment.