Skip to main content
summaryrefslogtreecommitdiffstats
path: root/agent/bin
diff options
context:
space:
mode:
authorEugene Tarassov2011-11-10 20:19:02 -0500
committerEugene Tarassov2011-11-10 20:19:02 -0500
commita107edc216f94c5ec059fdf74541908bc7e979bb (patch)
treea0d9a448043cf5b969c2ede059b7d19a3aa64b71 /agent/bin
parent07c7a005cded9e4b4ec842d756d0e4d79dade149 (diff)
downloadorg.eclipse.tcf.agent-a107edc216f94c5ec059fdf74541908bc7e979bb.tar.gz
org.eclipse.tcf.agent-a107edc216f94c5ec059fdf74541908bc7e979bb.tar.xz
org.eclipse.tcf.agent-a107edc216f94c5ec059fdf74541908bc7e979bb.zip
Agent code is moved into separate "agent" directory, all C code moved into "tcf" directory.
Diffstat (limited to 'agent/bin')
-rw-r--r--agent/bin/build-openssl47
-rw-r--r--agent/bin/get-os-tag19
-rw-r--r--agent/bin/mcc100
-rw-r--r--agent/bin/mcc-env102
-rw-r--r--agent/bin/services-to-cflags18
-rw-r--r--agent/bin/tests76
6 files changed, 362 insertions, 0 deletions
diff --git a/agent/bin/build-openssl b/agent/bin/build-openssl
new file mode 100644
index 00000000..7e318f20
--- /dev/null
+++ b/agent/bin/build-openssl
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+OpenSSL=$1
+OPSYS=$2
+MACHINE=$3
+CONF=$4
+
+BINDIR=`pwd`/obj/$OPSYS/$MACHINE/$CONF
+
+if [ "$OPSYS" = Windows ] ; then
+ . `dirname $0`/mcc-env
+fi
+
+cd $OpenSSL || exit 1
+
+if [ "$OPSYS" = Windows ] ; then
+
+ SSLCONF=VC-WIN32
+
+ if [ "$CONF" = Debug ] ; then
+ SSLCONF=debug-VC-WIN32
+ fi
+
+ rm -rf inc32 out32 out32.dbg || exit 1
+ perl Configure $SSLCONF || exit 1
+ cmd /c nmake -f ms\\nt.mak clean || exit 1
+ cmd /c ms\\do_nasm.bat || exit 1
+ cmd /c nmake -f ms\\nt.mak || exit 1
+
+elif [ "$OPSYS" = Cygwin ] ; then
+
+ ./config enable-static-engine no-dso || exit 1
+ make clean || exit 1
+ make build_libs || exit 1
+
+elif [ "$OPSYS" = MinGW -o "$OPSYS" = Msys ] ; then
+
+ ./Configure mingw enable-static-engine no-dso || exit 1
+ make clean || exit 1
+ make build_libs || exit 1
+
+else
+
+ echo "Invalid OPSYS: $OPSYS"
+ exit 1
+
+fi
diff --git a/agent/bin/get-os-tag b/agent/bin/get-os-tag
new file mode 100644
index 00000000..3ab5d23f
--- /dev/null
+++ b/agent/bin/get-os-tag
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+OPSYS=`uname -o 2>/dev/null || uname -s`
+
+if [ $OPSYS = Cygwin ] ; then
+ echo cygwin
+elif [ $OPSYS = GNU/Linux ] ; then
+ if [ -e /etc/fedora-release ] ; then
+ echo fc`rpm -q --queryformat='%{VERSION}\n' fedora-release 2>/dev/null`
+ elif [ -e /etc/redhat-release ] ; then
+ echo rh`sed -e 's/^.*release //' -e 's/ .*$//' -e 's/\\./_/g' </etc/redhat-release`
+ elif [ -e /etc/mandrake-release ] ; then
+ echo mdk
+ elif [ -e /etc/SuSE-release ] ; then
+ echo suse
+ fi
+fi
+
+
diff --git a/agent/bin/mcc b/agent/bin/mcc
new file mode 100644
index 00000000..79754478
--- /dev/null
+++ b/agent/bin/mcc
@@ -0,0 +1,100 @@
+#!/bin/bash
+
+# This script invokes Microsoft Visual Studio C compiler from CygWin shell.
+# The script command line parameters format is similar to GCC command line.
+# Command line options:
+# -c compile only
+# -g generate debug info
+# -O enable optimizations
+# -o<file> output file name
+# -D<name> macro definition
+# -I<dir> include directory
+# -p<file> PDB file name
+
+. `dirname $0`/mcc-env
+
+declare -a cmd
+cmdpos=0
+
+cflag=0
+gflag=0
+Oflag=0
+language=
+oval=
+
+while getopts co:D:I:gOp:x: name
+do
+ case $name in
+ c)
+ cmd[cmdpos]="/c"
+ cmdpos=`expr $cmdpos + 1`
+ cflag=1
+ ;;
+ g)
+ gflag=1
+ ;;
+ O)
+ Oflag=1
+ ;;
+ o)
+ oval="$OPTARG"
+ ;;
+ D)
+ cmd[cmdpos]="/D$OPTARG"
+ cmdpos=`expr $cmdpos + 1`
+ ;;
+ I)
+ cmd[cmdpos]="/I`cygpath -m "$OPTARG"`"
+ cmdpos=`expr $cmdpos + 1`
+ ;;
+ p)
+ cmd[cmdpos]="/Fd`cygpath -m "$OPTARG"`"
+ cmdpos=`expr $cmdpos + 1`
+ ;;
+ x)
+ language="$OPTARG"
+ ;;
+ *)
+ echo Invalid option $name
+ exit 2
+ ;;
+ esac
+done
+
+if [ $cflag != 0 ] ; then
+ if [ "$language" = "" -o "$language" = "c" ] ; then
+ cmd[cmdpos]="/TC"
+ cmdpos=`expr $cmdpos + 1`
+ elif [ "$language" = "c++" ] ; then
+ cmd[cmdpos]="/TP"
+ cmdpos=`expr $cmdpos + 1`
+ else
+ echo "Invalid value of -x"
+ exit 1
+ fi
+fi
+
+shift `expr $OPTIND - 1`
+
+if [ ! -z "$oval" ] ; then
+ if [ $cflag = 0 ] ; then
+ cmd[cmdpos]="/Fe$oval"
+ else
+ cmd[cmdpos]="/Fo$oval"
+ fi
+ cmdpos=`expr $cmdpos + 1`
+fi
+
+if [ $gflag = 1 ] ; then
+ CFLAGS1="/D_DEBUG /Zi /MTd"
+else
+ CFLAGS1="/DNDEBUG /GF /Gy /FD /MT"
+fi
+if [ $Oflag = 0 ] ; then
+ CFLAGS2="/Od"
+else
+ CFLAGS2="/O2 /Ob1"
+fi
+CFLAGS3="/Oy- /DWIN32 /D_CONSOLE /D_VC80_UPGRADE=0x0600 /D_MBCS /W4"
+
+cl.exe /nologo $CFLAGS1 $CFLAGS2 $CFLAGS3 "${cmd[@]}" "$@" || exit 1
diff --git a/agent/bin/mcc-env b/agent/bin/mcc-env
new file mode 100644
index 00000000..952c050e
--- /dev/null
+++ b/agent/bin/mcc-env
@@ -0,0 +1,102 @@
+if [ -z "$VSHOME" ] ; then
+ for KEY in \
+ "Microsoft/VisualStudio/10.0/Setup/VS/ProductDir" \
+ "Wow6432Node/Microsoft/VisualStudio/10.0/Setup/VS/ProductDir" \
+ "Microsoft/VisualStudio/9.0/Setup/VS/ProductDir" \
+ "Wow6432Node/Microsoft/VisualStudio/9.0/Setup/VS/ProductDir"
+ do
+ KEY="/proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/$KEY"
+ if [ -e "$KEY" ] ; then
+ KEY="`cat "$KEY"`"
+ KEY="`cygpath -u "$KEY"`"
+ if [ -d "$KEY" ] ; then
+ VSHOME="$KEY"
+ break
+ fi
+ fi
+ done
+ if [ -z "$VSHOME" ] ; then
+ for VAR in VS100COMNTOOLS VS90COMNTOOLS
+ do
+ DIR="${!VAR}"
+ if [ ! -z "$DIR" ] ; then
+ DIR="`cygpath -u "$DIR"`"
+ if [ -d "$DIR" ] ; then
+ VSHOME="$DIR/../.."
+ break
+ fi
+ fi
+ done
+ if [ -z "$VSHOME" ] ; then
+ for DIR in \
+ "/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0" \
+ "/cygdrive/c/Program Files/Microsoft Visual Studio 10.0" \
+ "/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 9.0" \
+ "/cygdrive/c/Program Files/Microsoft Visual Studio 9.0"
+ do
+ if [ -d "$DIR" ] ; then
+ VSHOME="$DIR"
+ break
+ fi
+ done
+ fi
+ fi
+fi
+
+if [ ! -d "$VSHOME" ] ; then
+ echo Invalid VSHOME - Microsoft Visual Studio directory name
+ exit 1
+fi
+
+if [ -z "$WINSDK" ] ; then
+ for KEY in \
+ "Microsoft/Microsoft SDKs/Windows/CurrentInstallFolder" \
+ "Wow6432Node/Microsoft/Microsoft SDKs/Windows/CurrentInstallFolder"
+ do
+ KEY="/proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/$KEY"
+ if [ -e "$KEY" ] ; then
+ KEY="`cat "$KEY"`"
+ KEY="`cygpath -u "$KEY"`"
+ if [ -d "$KEY" ] ; then
+ WINSDK="$KEY"
+ break
+ fi
+ fi
+ done
+ if [ -z "$WINSDK" ] ; then
+ for DIR in \
+ "/cygdrive/c/Program Files (x86)/Microsoft SDKs/Windows/v7.1" \
+ "/cygdrive/c/Program Files/Microsoft SDKs/Windows/v7.1" \
+ "/cygdrive/c/Program Files (x86)/Microsoft SDKs/Windows/v7.0A" \
+ "/cygdrive/c/Program Files/Microsoft SDKs/Windows/v7.0A" \
+ "/cygdrive/c/Program Files/Microsoft SDKs/Windows/v6.1" \
+ "/cygdrive/c/Program Files/Microsoft SDKs/Windows/v6.0A"
+ do
+ if [ -d "$DIR" ] ; then
+ WINSDK="$DIR"
+ break
+ fi
+ done
+ fi
+fi
+
+if [ ! -d "$WINSDK" ] ; then
+ echo Invalid WINSDK - Microsoft SDK directory name
+ exit 1
+fi
+
+export DevEnvDir=$(cygpath -aw "$VSHOME/Common7/IDE")
+export WindowsSdkDir=$(cygpath -aw "$WINSDK/")
+export VSINSTALLDIR=$(cygpath -aw "$VSHOME")
+export VCINSTALLDIR=$(cygpath -aw "$VSHOME/VC")
+export FrameworkDir=Framework32
+export LIB=$(cygpath -aw "$VSHOME/VC/lib")\;$(cygpath -aw "$WINSDK/Lib")
+export INCLUDE=$(cygpath -aw "$VSHOME/VC/include")\;$(cygpath -aw "$WINSDK/Include")
+export PATH="$VSHOME/Common7/IDE:$VSHOME/VC/bin:$VSHOME/Common7/Tools:$VSHOME/VC/VCPackages:$PATH"
+
+unset MAKEFLAGS
+unset MAKELEVEL
+unset MAKEOVERRIDES
+
+
+
diff --git a/agent/bin/services-to-cflags b/agent/bin/services-to-cflags
new file mode 100644
index 00000000..9ef7119c
--- /dev/null
+++ b/agent/bin/services-to-cflags
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+for PREFIX in SERVICE_ ENABLE_
+do
+ NAMES=`sed -n "s/.*#if *\!defined *( *$PREFIX\([^ ]*\) *).*/\1/p" <config.h`
+ for NAME in $NAMES
+ do
+ VALUE=0
+ for ARG in $*
+ do
+ if [ $NAME = $ARG ]
+ then
+ VALUE=1
+ fi
+ done
+ echo -D$PREFIX$NAME=$VALUE
+ done
+done
diff --git a/agent/bin/tests b/agent/bin/tests
new file mode 100644
index 00000000..89b4d52e
--- /dev/null
+++ b/agent/bin/tests
@@ -0,0 +1,76 @@
+#!/bin/bash
+
+# This script builds and runs TCF tests.
+# Command line:
+# tests <peer description>
+# Enviroment variables:
+# JAVAHOME - path to Java SDK directory
+# TCFROOT - path to TCF source code root directory
+# Example:
+# tests ID=Test:TransportName=TCP:Host=127.0.0.1:Port=1534
+
+if [ -z "$JAVAHOME" ]
+then
+ DIR="/cygdrive/c/Program Files/Java/jdk1.6.0_12"
+ if [ -d "$DIR" ]
+ then
+ JAVAHOME="$DIR"
+ fi
+fi
+
+if [ -z "$TCFROOT" ]
+then
+ cd `dirname "$0"`/../.. || exit 1
+ TCFROOT="`pwd`"
+fi
+
+if [ ! -d "$JAVAHOME" ]
+then
+ echo Invalid JAVAHOME
+ exit 1
+fi
+
+if [ ! -d "$TCFROOT" ]
+then
+ echo Invalid TCFROOT
+ exit 1
+fi
+
+rm -rf "$TCFROOT/agent/obj/java" || exit 1
+mkdir -p "$TCFROOT/agent/obj/java" || exit 1
+
+TCFROOTJC="$TCFROOT"
+if [ -f /usr/bin/cygpath ]
+then
+ TCFROOTJC="`/usr/bin/cygpath -w "$TCFROOTJC"`"
+fi
+
+SRCPATH="$TCFROOTJC/plugins/org.eclipse.tm.tcf"
+
+"$JAVAHOME/bin/javac" -g \
+ -sourcepath "$SRCPATH.core/src"\;"$SRCPATH.debug/src" \
+ -d "$TCFROOTJC/agent/obj/java" \
+ "$SRCPATH.debug/src/org/eclipse/tm/internal/tcf/debug/tests/Main.java" \
+ || exit 1
+
+cd "$TCFROOT/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/internal/tcf/services/remote" || exit 1
+for FILE in `ls *.java`
+do
+ "$JAVAHOME/bin/javac" -g \
+ -classpath "$TCFROOTJC/agent/obj/java" \
+ -sourcepath "$SRCPATH.core/src" \
+ -d "$TCFROOTJC/agent/obj/java" \
+ "$SRCPATH.core/src/org/eclipse/tm/internal/tcf/services/remote/$FILE" \
+ || exit 1
+done
+
+cd "$TCFROOT/agent/obj/java" || exit 1
+
+"$JAVAHOME/bin/java" \
+ -classpath "$TCFROOTJC/agent/obj/java" \
+ org.eclipse.tm.internal.tcf.debug.tests.Main \
+ $1 || exit 1
+
+
+
+

Back to the top