Index: /trunk/kBuild/env.sh
===================================================================
--- /trunk/kBuild/env.sh	(revision 1529)
+++ /trunk/kBuild/env.sh	(revision 1530)
@@ -33,4 +33,5 @@
 DBG_REDIR=1
 EVAL_OPT=
+EVAL_EXPORT="export "
 DBG_OPT=
 QUIET_OPT=
@@ -39,11 +40,12 @@
 VAR_OPT=
 VALUE_ONLY_OPT=
+EXP_TYPE_OPT=
 while test $# -gt 0; 
 do
     case "$1" in
-        "--debug")
+        "--debug-script")
             DBG_OPT="true"
             ;;
-        "--no-debug")
+        "--no-debug-script")
             DBG_OPT=
             ;;
@@ -68,4 +70,10 @@
         "--eval")
             EVAL_OPT="true"
+            ERR_REDIR=2
+            DBG_REDIR=2
+            ;;
+        "--set")
+            EVAL_OPT="true"
+            EVAL_EXPORT=""
             ERR_REDIR=2
             DBG_REDIR=2
@@ -83,4 +91,20 @@
             VALUE_ONLY_OPT=
             ;;
+        "--release")
+            EXP_TYPE_OPT=1
+            KBUILD_TYPE=release
+            BUILD_TYPE=
+            ;;
+        "--debug")
+            EXP_TYPE_OPT=1
+            KBUILD_TYPE=debug
+            BUILD_TYPE=
+            ;;
+        "--profile")
+            EXP_TYPE_OPT=1
+            KBUILD_TYPE=profile
+            BUILD_TYPE=
+            ;;
+
         "--help")
             echo "kBuild Environment Setup Script, v0.1.3"
@@ -99,6 +123,8 @@
             echo ""
             echo "Options:"
-            echo "  --debug, --no-debug"
-            echo "      Controls debug output. Default: --no-debug"
+            echo "  --debug, --release, --profile"
+            echo "      Alternative way of specifying KBUILD_TYPE."
+            echo "  --debug-script, --no-debug-script"
+            echo "      Controls debug output. Default: --no-debug-script"
             echo "  --quiet, --verbose"
             echo "      Controls informational output. Default: --verbose"
@@ -109,4 +135,8 @@
             echo "  --value-only, --name-and-value"
             echo "      Controls what the result of a --var query. Default: --name-and-value"
+            echo "  --set, --export"
+            echo "      Whether --eval explicitly export the variables. --set is useful for"
+            echo "      getting a list of environment vars for a commandline, while --eval"
+            echo "      is useful for eval `env.sh`. Default: --export"
             echo ""
             exit 1
@@ -473,5 +503,5 @@
 
         if test -n "$EVAL_OPT"; then
-            echo "export $var=$val"
+            echo "${EVAL_EXPORT} $var=$val"
         else
             if test -n "$VALUE_ONLY_OPT"; then
@@ -486,24 +516,24 @@
         # Echo statements for the shell to evaluate.
         test -n "$DBG_OPT" && echo "dbg: echoing exported variables" 1>&${DBG_REDIR}
-        echo "export PATH=${PATH}"
+        echo "${EVAL_EXPORT} PATH=${PATH}"
+        test -n "${FULL_OPT}" -o "${EXP_TYPE_OPT}" && echo "${EVAL_EXPORT} KBUILD_TYPE=${KBUILD_TYPE}"
         if test -n "${FULL_OPT}"; then
-            echo "export KBUILD_PATH=${KBUILD_PATH}"
-            echo "export KBUILD_TYPE=${KBUILD_TYPE}"
-            echo "export KBUILD_HOST=${KBUILD_HOST}"
-            echo "export KBUILD_HOST_ARCH=${KBUILD_HOST_ARCH}"
-            echo "export KBUILD_HOST_CPU=${KBUILD_HOST_CPU}"
-            echo "export KBUILD_TARGET=${KBUILD_TARGET}"
-            echo "export KBUILD_TARGET_ARCH=${KBUILD_TARGET_ARCH}"
-            echo "export KBUILD_TARGET_CPU=${KBUILD_TARGET_CPU}"
+            echo "${EVAL_EXPORT} KBUILD_PATH=${KBUILD_PATH}"
+            echo "${EVAL_EXPORT} KBUILD_HOST=${KBUILD_HOST}"
+            echo "${EVAL_EXPORT} KBUILD_HOST_ARCH=${KBUILD_HOST_ARCH}"
+            echo "${EVAL_EXPORT} KBUILD_HOST_CPU=${KBUILD_HOST_CPU}"
+            echo "${EVAL_EXPORT} KBUILD_TARGET=${KBUILD_TARGET}"
+            echo "${EVAL_EXPORT} KBUILD_TARGET_ARCH=${KBUILD_TARGET_ARCH}"
+            echo "${EVAL_EXPORT} KBUILD_TARGET_CPU=${KBUILD_TARGET_CPU}"
 
             if test -n "${LEGACY_OPT}"; then
-                echo "export PATH_KBUILD=${KBUILD_PATH}"
-                echo "export BUILD_TYPE=${KBUILD_TYPE}"
-                echo "export BUILD_PLATFORM=${KBUILD_HOST}"
-                echo "export BUILD_PLATFORM_ARCH=${KBUILD_HOST_ARCH}"
-                echo "export BUILD_PLATFORM_CPU=${KBUILD_HOST_CPU}"
-                echo "export BUILD_TARGET=${KBUILD_TARGET}"
-                echo "export BUILD_TARGET_ARCH=${KBUILD_TARGET_ARCH}"
-                echo "export BUILD_TARGET_CPU=${KBUILD_TARGET_CPU}"
+                echo "${EVAL_EXPORT} PATH_KBUILD=${KBUILD_PATH}"
+                echo "${EVAL_EXPORT} BUILD_TYPE=${KBUILD_TYPE}"
+                echo "${EVAL_EXPORT} BUILD_PLATFORM=${KBUILD_HOST}"
+                echo "${EVAL_EXPORT} BUILD_PLATFORM_ARCH=${KBUILD_HOST_ARCH}"
+                echo "${EVAL_EXPORT} BUILD_PLATFORM_CPU=${KBUILD_HOST_CPU}"
+                echo "${EVAL_EXPORT} BUILD_TARGET=${KBUILD_TARGET}"
+                echo "${EVAL_EXPORT} BUILD_TARGET_ARCH=${KBUILD_TARGET_ARCH}"
+                echo "${EVAL_EXPORT} BUILD_TARGET_CPU=${KBUILD_TARGET_CPU}"
             fi
         fi
@@ -511,7 +541,7 @@
         # Export variables.
         export PATH
+        test -n "${FULL_OPT}" -o "${EXP_TYPE_OPT}" && export KBUILD_TYPE
         if test -n "${FULL_OPT}"; then
             export KBUILD_PATH
-            export KBUILD_TYPE
             export KBUILD_HOST
             export KBUILD_HOST_ARCH
