#!/bin/bash
#
# $Date: 2009/06/16 23:39:00$

# This file should be sourced (i.e., '. <filename>' or 'source <filename>')

# If your Java compiler can handle mixed windows and Unix pathnames, then
# you can avoid using this cygwin version of the setup file by doing
# the following, which appears to work fine under Cygwin 1.5.9 with JDK 1.4.2:
#   source example-developers-sourceme-unix.sh
#   CLASSPATH=`cygpath -pwa "$CLASSPATH"`
#   JFILESEP='\\'
#   JPATHSEP=';'

# JML_DEV_BASE  : directory under which MJ and JML2 will reside.
: ${JML_DEV_BASE:=$HOME}
# JML_PKG_PREFIX: path prefix to JML required third party packages.
: ${JML_PKG_PREFIX:=/usr/local}
# Major Java version to be used in building paths, etc. for JML.
: ${JML_JAVA_MAJ_VERS:=4}
# JDT directory name to be used in building JML:
: ${JML_JDK_DIR:=jdk1.$JML_JAVA_MAJ_VERS}

# Java CLASSPATH setting (comment this out if you don't need it).
# The default below automatically converts a unix-like path to a Windows path.
export CLASSPATH=".:$JML_DEV_BASE/MJ:$JML_DEV_BASE/JML2:$JML_DEV_BASE/JMLdocuments:$JML_PKG_PREFIX/antlr/antlr.jar:$JML_PKG_PREFIX/junit/junit.jar:$JML_PKG_PREFIX/gnu:$JML_DEV_BASE/JML2/specs:$JML_PKG_PREFIX/ant/lib/ant.jar"

if [ "$JML_JAVA_MAJ_VERS" == "5" ]; then
    # The following are needed by the MJ build:
    export JAVA5=t
    export JAVATOOLS15=$JAVA_HOME/lib/tools.jar
    export CLASSPATH="$CLASSPATH:$JAVATOOLS15"
else
    export CLASSPATH="$CLASSPATH:$JML_PKG_PREFIX/$JML_JDK_DIR/lib/tools.jar"
fi

CLASSPATH=`cygpath -pwa "$CLASSPATH"`

# For building mjdoc and jmldoc with multiple versions at once.
# You can comment these out, either one or both, if you like.
export JAVATOOLS141=`cygpath -pwa "$JML_PKG_PREFIX/jdk1.4.1/lib/tools.jar"`
export JAVATOOLS142=`cygpath -pwa "$JML_PKG_PREFIX/jdk1.4/lib/tools.jar"`

# For building the ant portions of JML and MJ
export ANT_HOME=/usr/local/ant

# The double backslashes below may be necessary for some java compilers
# and were formerly needed under Sun's javac for Windows.
# When make uses the environment variables the \\ becomes \, which is
# what javac for Windows expects as a file separator character.

# The shell's name of the directory containing the MJC project files
export PLSL_CLASSROOT="$JML_DEV_BASE/MJ"
export MJ_CLASSROOT="$JML_DEV_BASE/MJ"

# OS native (javac compatible) format for
# the name of the directory containing the MJC project files
export MJ_JCLASSROOT=`cygpath -wa "$JML_DEV_BASE/MJ" | sed -e 's@\\\\@\\\\\\\\@g'`
# or use something like:
# export MJ_JCLASSROOT='c:\\cygwin\\home\\cclifton\\MJ'

# The shell's name of the directory containing the JML project files
export JML_CLASSROOT=`cygpath -m "$JML_DEV_BASE/JML2"`

# OS native (javac compatible) format for
# the name of the directory containing the JML project files
export JML_JCLASSROOT=`cygpath -wa "$JML_DEV_BASE/JML2" | sed -e 's@\\\\@\\\\\\\\@g'`
# or use something like:
# export JML_JCLASSROOT='c:\\cygwin\\home\\cclifton\\JML2'

# relative path name to the MJC project files
export MJ_RELATIVE_ROOT='../MJ'

# Java file separator character on this machine
export JFILESEP='\\'

# Java path separator character on this machine
export JPATHSEP=';'

# Name of the java compiler
: ${JAVAC='javac'}
export JAVAC

# Name of the java virtual machine
: ${JAVA='java'}
export JAVA

# Temporary directory in OS native format
: ${TEMP=$HOME/temp}
export TEMP
export JTEMP=`cygpath -wa "${TEMP}" | sed -e 's@\\\\@\\\\\\\\@g'`
# or use something like the following (on Windows 2000/XP):
# export JTEMP='c:\\DOCUME~1\\cclifton\\LOCALS~1\\Temp'

# Use forward slashes on all machines for URLs below.

# URL for the directory containing the javadocs for the JDK on this machine
export JDKDOCDIR="file:`cygpath -ma $JML_PKG_PREFIX/$JML_JDK_DIR/docs/api`"

# URL for the directory containing the javadocs for antlr on this machine
export ANTLRDOCDIR="file:`cygpath -ma $JML_PKG_PREFIX/antlr/javadocs`"

# URL for the directory containing the javadocs for MJC on this machine
export JDLINKS="-link file:`cygpath -ma $JML_DEV_BASE`/MJ/javadocs"
# or use something like the following
# export JDLINKS='c:/cygwin/home/cclifton/MJ/javadocs'

## Copyright (C) 2000-2008 Iowa State University
##
## This file is part of JML, the Java Modeling Language
##
## 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
