#! /bin/bash
#
# (C) Copyright IBM Corp. 2001, 2003, 2004
#
#
# This file defines a set of environment variables needed to build and
# run Jikes RVM.  This file is sourced by the installation scripts; you
# do not need to source this file into your command-prompt shell.
#
# IMPORTANT: You need to modify this file to reflect your environment!
#

#########
# PART I: Preprocessor directives that hold for every config on this target
#
# If you're using Debian GNU/Linux with a 2.2 or 2.4 kernel, then 
# you'll want to enable RVM_FOR_SINGLE_VIRTUAL_PROCESSOR.  Otherwise, 
# you should not need to change anything in this section.
#########
# target architecture is Intel x86 (IA32)
export RVM_FOR_IA32=1
export RVM_FOR_32_ADDR=1

# The target OS kernel is Linux
export RVM_FOR_LINUX=1

# NOTE: the key requirement for setting this to 0 (ie having SMP support)
#       is that you have a 2.4 kernel and that glibc is compiled 
#       to use the GS segment register to access pthread-local storage.  
#	(Another way of saying this is that glibc is compiled to 
#	 handle "floating stacks").
#       See the FAQ in the Jikes RVM User's Guide.
#
#       This is now quite common. For example, in Red Hat 7 and later.  
#       So, the default is 0.  The Big Exception is if you are using Debian
#       GNU/Linux with a 2.4 or 2.2 kernel.  Debian with a 2.6 kernel will 
#	work, but it won't work with a 2.4 or 2.2 kernel.
#
export RVM_FOR_SINGLE_VIRTUAL_PROCESSOR=0
## Use this for Debian GNU/Linux with a Linux 2.4 kernel, 
## and for any Linux 2.2 kernel:
# export RVM_FOR_SINGLE_VIRTUAL_PROCESSOR=1

export BOOTIMAGE_LOAD_ADDRESS=0x43000000
export MAXIMUM_MAPPABLE_ADDRESS=0xc0000000

##########
# PART II: Where to find tools and resources on this target
#
# The configuration process can make use of auto-guessing features in
# the RVM_ROOT/rvm/bin/jconfigure program.  You can see the results of
# its guesses in "RVM_BUILD/environment.host".  (This particular file
# doesn't use those features, though, since they get confused if
# you're doing a cross-build.)
########## 

# HOST_VM_TYPE=Kaffe
HOST_VM_TYPE=Sun
# HOST_VM_TYPE=JikesRVM

# Root of JDK installation.
[[ ${HOST_JAVA_HOME-} ]] || HOST_JAVA_HOME="/usr/lib/j2se/1.4"

# the JDK java executable
export HOST_VM_RT="$HOST_JAVA_HOME/jre/bin/java"

# 1.4.x JDKs on Linux seem to require that LD_LIBRARY_PATH be set to include
# the JRE's various library paths (otherwise they don't find their .so files 
# when invoked from shell scripts and make).
# Here's how to do it to use HotSpot server with Blackdown 1.4.1
export HOST_JAVA_LD_LIBRARY_PATH="$HOST_JAVA_HOME/jre/lib/i386/:$HOST_JAVA_HOME/jre/lib/i386/server"
# Here's how to do it to using the IBM 1.4.1 DK 
#export HOST_JAVA_LD_LIBRARY_PATH="$HOST_JAVA_HOME/jre/bin/classic:$HOST_JAVA_HOME/jre/bin/"

# the JDK Javadoc executable
export HOST_JAVADOC="$HOST_JAVA_HOME/bin/javadoc"

# the JDK javac executable
export HOST_JAVAC="$HOST_JAVA_HOME/bin/javac"

# the JDK jar executable
export JAR="$HOST_JAVA_HOME/bin/jar"

# the JDK standard library jar files
export HOST_REPOSITORIES="$HOST_JAVA_HOME/jre/lib/rt.jar"

# the JDK tools jar
export HOST_TOOLS="$HOST_JAVA_HOME/lib/tools.jar"

## CLASSPATH_INSTALLATION
## If you built GNU Classpath with the default install directory (if
## unspecified, "--prefix=/usr/local/classpath" is implied) and
## installed it with "make install", then uncomment this line:
#
# export CLASSPATH_INSTALLATION=/usr/local/classpath

## If you don't have such an installation (most people don't), 
## you can *instead* set CLASSPATH_ROOT: 

# CLASSPATH_ROOT: Directory containing the unpacked and built sources 
# for GNU Classpath 0.10 
# (current stable version of Classpath)
# Uncomment this line only if you manually downloaded the Classpath sources.
# export CLASSPATH_ROOT=/opt/classpath-0.10

## OR you can leave all of the CLASSPATH_ variables unset and let the build 
## process download and build GNU Classpath for you.

# Path for GNU make
export GNU_MAKE="/usr/bin/make"

# Path for the Jikes java-to-byte-code compiler.
# Try Jikes 1.13 if you have trouble figuring out the error messages
# from Jikes 1.18 or 1.19.  Don't use Jikes 1.14 -- 1.17 or 1.20.  
# We haven't tested Jikes 1.21 yet. 
export JIKES=/usr/bin/jikes

# What C/C++ compiler should be used?
export CC='/usr/bin/gcc -w -g -O'

# what C++ compilers should be used?
export CPLUS='/usr/bin/g++ -w -g -O'

# how to link a shared C++ library (possibly also recompile one 
# or more source files in it)
export LDSHARED="${CPLUS} -shared"

# The configuration for building the user guide.
# You may have to edit this file.
export USER_GUIDE_CONFIG="${RVM_ROOT}/rvm/doc/userguide/config.mk"

# some Unix commands used in sanity rules and automatic rvmrt retrieval
export AWK="/usr/bin/awk"
export BASH="/bin/bash"
# You need one of Yacc or Bison (one will usually be installed)
# If you're using Bison, uncomment the line below:
# BISON="bison"
export CVS="/usr/bin/cvs"
export DIFF="/usr/bin/diff"
export FGREP="/bin/fgrep"
export FIND="/usr/bin/find"
export GNU_TAR=/bin/tar
export GREP="/bin/grep"
export MD5SUM="/usr/bin/md5sum"
export PS="/bin/ps"
export SED="/bin/sed"
export WGET="/usr/bin/wget"
export XARGS="/usr/bin/xargs"
export UNZIP_CMD="/usr/bin/unzip"

##########
# PART III: Additional variables for running Eclipse on Jikes RVM
########## 
# These are used only by the jbuild.plugin build script.

export ANT_CMD=/opt/jakarta-ant-1.5.3/bin/ant

export ECLIPSE_INSTALL_DIR="$HOME/eclipse-2.1"

##########
# PART IV: Miscellaneous variables.
#
# If you add any variables to this section, please document them.  Please.
##########

# BENCHMARK_ROOT is used in running some of the Jikes RVM regression
# tests.  It doesn't need to be set unless you are running those tests.
export BENCHMARK_ROOT=""

# Used for the Emacs spell-checker
#  LocalWords:  JDK JDKs LD JRE's HotSpot Blackdown DK CPLUS LDSHARED JNI ld bM
#  LocalWords:  bnoentry SRE lc bE
