Index: trunk/src/VBox/Devices/EFI/Firmware2/VBoxPkg/env.sh
===================================================================
--- trunk/src/VBox/Devices/EFI/Firmware2/VBoxPkg/env.sh	(revision 44613)
+++ trunk/src/VBox/Devices/EFI/Firmware2/VBoxPkg/env.sh	(revision 44614)
@@ -2,8 +2,9 @@
 # $Id$
 # @file
-# Environmental Setup Script for VBoxPkg + EDK2.
+# Environment Setup Script for VBoxPkg + EDK2 (OVMF).
+#
 
 #
-# Copyright (C) 2010 Oracle Corporation
+# Copyright (C) 2010-2013 Oracle Corporation
 #
 # This file is part of VirtualBox Open Source Edition (OSE), as
@@ -37,14 +38,23 @@
 case $BUILD_PLATFORM in
     darwin)
-    export IA32_PETOOLS_PREFIX=/opt/local/bin
-    export X64_PETOOLS_PREFIX=$HOME/mingw-w64-bin_i686-darwin_20091111/bin
-    export IPF_PETOOLS_PREFIX=__no_ipf__
-
-    sed -e "s/^\(DEFINE UNIXGCC_\)\(.*\)\(_PETOOLS_PREFIX\).*/\1\2\3 = ENV(\2_PETOOLS_PREFIX)/g" $CONF_FILE > $TMP_CONF_DEFINE
-    sed -e "s/^\(DEFINE UNIX_\)\(IASL_BIN\).*/\1\2 = ENV(\2)/g" $TMP_CONF_DEFINE > $TMP_CONF_IASL
-    sed -e "s/^\(\*_\)\(UNIXGCC_IA32_\)\(.*\)\(_PATH\).*\/\(.*\)$/\1\2\3\4 = DEF(\2PETOOLS_PREFIX)\/i386-mingw32-\5/g" $TMP_CONF_IASL > $TMP_CONF_DECL
-    sed -e "s/^\(\*_\)\(UNIXGCC_X64_\)\(.*\)\(_PATH\).*\/\(.*\)$/\1\2\3\4 = DEF(\2PETOOLS_PREFIX)\/x86_64-mingw64-\5/g" $TMP_CONF_IASL > $TMP_CONF_DECL
-
-    ;;
+        export IA32_PETOOLS_PREFIX=/opt/local/bin
+        export X64_PETOOLS_PREFIX=$HOME/mingw-w64-bin_i686-darwin_20091111/bin
+        export IPF_PETOOLS_PREFIX=__no_ipf__
+        if [ "$USER" = "bird" ]; then
+            export IA32_PETOOLS_PREFIX=/Users/bird/coding/tianocore/edk2/trunk-tools32/bin/i686-pc-mingw32-
+            export X64_PETOOLS_PREFIX=/Users/bird/coding/tianocore/edk2/trunk-tools/bin/x86_64-pc-mingw32-
+        fi
+        
+        sed -e "s/^\(DEFINE UNIXGCC_\)\(.*\)\(_PETOOLS_PREFIX\).*/\1\2\3 = ENV(\2_PETOOLS_PREFIX)/g" $CONF_FILE > $TMP_CONF_DEFINE
+        sed -e "s/^\(DEFINE UNIX_\)\(IASL_BIN\).*/\1\2 = ENV(\2)/g" $TMP_CONF_DEFINE > $TMP_CONF_IASL
+        #Not sure if any of the following is necessary/working with OVMF.
+        sed -e "s/^\(\*_\)\(UNIXGCC_IA32_\)\(.*\)\(_PATH\).*\/\(.*\)$/\1\2\3\4 = DEF(\2PETOOLS_PREFIX)\/i386-mingw32-\5/g" $TMP_CONF_IASL > $TMP_CONF_DECL
+        if [ "$USER" = "bird" ]; then
+             sed -e "s/^\(\*_\)\(UNIXGCC_X64_\)\(.*\)\(_PATH\).*\/\(.*\)$/\1\2\3\4 = DEF(\2PETOOLS_PREFIX)\/x86_64-mingw32-\5/g" $TMP_CONF_IASL > $TMP_CONF_DECL
+        else
+             sed -e "s/^\(\*_\)\(UNIXGCC_X64_\)\(.*\)\(_PATH\).*\/\(.*\)$/\1\2\3\4 = DEF(\2PETOOLS_PREFIX)\/x86_64-mingw64-\5/g" $TMP_CONF_IASL > $TMP_CONF_DECL
+        fi
+        
+        ;;
     linux)
     # Defines here suitable for mingw that comes with Ubuntu
@@ -84,7 +94,11 @@
 
 cp $TMP_CONF_DECL $TARGET_CONF_FILE
+
+if [ -z "$FIRMWARE_ARCH" ]; then
+    FIRMWARE_ARCH="IA32"
+fi
 case  "$FIRMWARE_ARCH"  in
-    "IA32") active=VBoxPkg/VBoxPkg.dsc;;
-    "X64" ) active=VBoxPkg/VBoxPkgX64.dsc;;
+    "IA32") active=OvmfPkg/OvmfPkgIa32.dsc;;
+    "X64" ) active=OvmfPkg/OvmfPkgX64.dsc;;
 esac
 echo "ACTIVE_PLATFORM = " $active > $TARGET_FILE
@@ -105,9 +119,14 @@
 export IASL_BIN=$PATH_DEVTOOLS/$BUILD_PLATFORM.$BUILD_PLATFORM_ARCH/bin/iasl
 
-[ ! -d VBoxPkg/Include/VBox ] && ln -s $PATH_DEVTOOLS/../include/VBox VBoxPkg/Include/VBox
-[ ! -d VBoxPkg/Include/iprt ] && ln -s $PATH_DEVTOOLS/../include/iprt VBoxPkg/Include/iprt
-[ ! -f VBoxPkg/Include/version-generated.h ] && ln -s $PATH_DEVTOOLS/../out/$BUILD_PLATFORM.$BUILD_PLATFORM_ARCH/$BUILD_TYPE/version-generated.h VBoxPkg/Include/version-generated.h
-[ ! -f VBoxPkg/Include/product-generated.h ] && ln -s $PATH_DEVTOOLS/../out/$BUILD_PLATFORM.$BUILD_PLATFORM_ARCH/$BUILD_TYPE/product-generated.h VBoxPkg/Include/product-generated.h
-[ ! -f VBoxPkg/VBoxPUELLogo/puel_logo.bmp ] && ln -s $PATH_DEVTOOLS/../src/VBox/Devices/Graphics/BIOS/puel_logo.bmp VBoxPkg/VBoxPUELLogo/puel_logo.bmp
+VBOX_ROOT=$PATH_DEVTOOLS/..
+if [ ! -f "$VBOX_ROOT/Config.kmk" ]; then
+    echo "Warning! $VBOX_ROOT doesn't seem to be the root of the VirtualBox source tree!"
+fi
+
+[ ! -d VBoxPkg/Include/VBox ] && ln -s $VBOX_ROOT/include/VBox VBoxPkg/Include/VBox
+[ ! -d VBoxPkg/Include/iprt ] && ln -s $VBOX_ROOT/include/iprt VBoxPkg/Include/iprt
+[ ! -f VBoxPkg/Include/version-generated.h ] && ln -s $VBOX_ROOT/out/$BUILD_PLATFORM.$BUILD_PLATFORM_ARCH/$BUILD_TYPE/version-generated.h VBoxPkg/Include/version-generated.h
+[ ! -f VBoxPkg/Include/product-generated.h ] && ln -s $VBOX_ROOT/out/$BUILD_PLATFORM.$BUILD_PLATFORM_ARCH/$BUILD_TYPE/product-generated.h VBoxPkg/Include/product-generated.h
+[ ! -f VBoxPkg/VBoxPUELLogo/puel_logo.bmp ] && ln -s $VBOX_ROOT/src/VBox/Devices/Graphics/BIOS/puel_logo.bmp VBoxPkg/VBoxPUELLogo/puel_logo.bmp
 
 # Tools should be ready at this point.
@@ -117,8 +136,10 @@
 if [ -z "$VBOXPKG_ENV_NON_INTERECTIVE" ]
 then
+    export ARCH=IA32
+
     RC=/tmp/efidev$$
     rm -f $RC
-    echo PS1=\"EFI-Build\>\" >> $RC
-    echo "export ARCH=IA32" >> $RC
+    echo "if [ ~/.bashrc ]; then . ~/.bashrc; fi" > $RC
+    echo "export PS1='\[\033[01;32m\]VBox/trunk/EFI \u@\h \[\033[01;34m\]\W \$ \[\033[00m\]'" >> $RC
     $SHELL --init-file $RC
     rm -f $RC
