Changeset 1530
- Timestamp:
- Apr 19, 2008, 11:56:31 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kBuild/env.sh
r1517 r1530 33 33 DBG_REDIR=1 34 34 EVAL_OPT= 35 EVAL_EXPORT="export " 35 36 DBG_OPT= 36 37 QUIET_OPT= … … 39 40 VAR_OPT= 40 41 VALUE_ONLY_OPT= 42 EXP_TYPE_OPT= 41 43 while test $# -gt 0; 42 44 do 43 45 case "$1" in 44 "--debug ")46 "--debug-script") 45 47 DBG_OPT="true" 46 48 ;; 47 "--no-debug ")49 "--no-debug-script") 48 50 DBG_OPT= 49 51 ;; … … 68 70 "--eval") 69 71 EVAL_OPT="true" 72 ERR_REDIR=2 73 DBG_REDIR=2 74 ;; 75 "--set") 76 EVAL_OPT="true" 77 EVAL_EXPORT="" 70 78 ERR_REDIR=2 71 79 DBG_REDIR=2 … … 83 91 VALUE_ONLY_OPT= 84 92 ;; 93 "--release") 94 EXP_TYPE_OPT=1 95 KBUILD_TYPE=release 96 BUILD_TYPE= 97 ;; 98 "--debug") 99 EXP_TYPE_OPT=1 100 KBUILD_TYPE=debug 101 BUILD_TYPE= 102 ;; 103 "--profile") 104 EXP_TYPE_OPT=1 105 KBUILD_TYPE=profile 106 BUILD_TYPE= 107 ;; 108 85 109 "--help") 86 110 echo "kBuild Environment Setup Script, v0.1.3" … … 99 123 echo "" 100 124 echo "Options:" 101 echo " --debug, --no-debug" 102 echo " Controls debug output. Default: --no-debug" 125 echo " --debug, --release, --profile" 126 echo " Alternative way of specifying KBUILD_TYPE." 127 echo " --debug-script, --no-debug-script" 128 echo " Controls debug output. Default: --no-debug-script" 103 129 echo " --quiet, --verbose" 104 130 echo " Controls informational output. Default: --verbose" … … 109 135 echo " --value-only, --name-and-value" 110 136 echo " Controls what the result of a --var query. Default: --name-and-value" 137 echo " --set, --export" 138 echo " Whether --eval explicitly export the variables. --set is useful for" 139 echo " getting a list of environment vars for a commandline, while --eval" 140 echo " is useful for eval `env.sh`. Default: --export" 111 141 echo "" 112 142 exit 1 … … 473 503 474 504 if test -n "$EVAL_OPT"; then 475 echo " export$var=$val"505 echo "${EVAL_EXPORT} $var=$val" 476 506 else 477 507 if test -n "$VALUE_ONLY_OPT"; then … … 486 516 # Echo statements for the shell to evaluate. 487 517 test -n "$DBG_OPT" && echo "dbg: echoing exported variables" 1>&${DBG_REDIR} 488 echo "export PATH=${PATH}" 518 echo "${EVAL_EXPORT} PATH=${PATH}" 519 test -n "${FULL_OPT}" -o "${EXP_TYPE_OPT}" && echo "${EVAL_EXPORT} KBUILD_TYPE=${KBUILD_TYPE}" 489 520 if test -n "${FULL_OPT}"; then 490 echo "export KBUILD_PATH=${KBUILD_PATH}" 491 echo "export KBUILD_TYPE=${KBUILD_TYPE}" 492 echo "export KBUILD_HOST=${KBUILD_HOST}" 493 echo "export KBUILD_HOST_ARCH=${KBUILD_HOST_ARCH}" 494 echo "export KBUILD_HOST_CPU=${KBUILD_HOST_CPU}" 495 echo "export KBUILD_TARGET=${KBUILD_TARGET}" 496 echo "export KBUILD_TARGET_ARCH=${KBUILD_TARGET_ARCH}" 497 echo "export KBUILD_TARGET_CPU=${KBUILD_TARGET_CPU}" 521 echo "${EVAL_EXPORT} KBUILD_PATH=${KBUILD_PATH}" 522 echo "${EVAL_EXPORT} KBUILD_HOST=${KBUILD_HOST}" 523 echo "${EVAL_EXPORT} KBUILD_HOST_ARCH=${KBUILD_HOST_ARCH}" 524 echo "${EVAL_EXPORT} KBUILD_HOST_CPU=${KBUILD_HOST_CPU}" 525 echo "${EVAL_EXPORT} KBUILD_TARGET=${KBUILD_TARGET}" 526 echo "${EVAL_EXPORT} KBUILD_TARGET_ARCH=${KBUILD_TARGET_ARCH}" 527 echo "${EVAL_EXPORT} KBUILD_TARGET_CPU=${KBUILD_TARGET_CPU}" 498 528 499 529 if test -n "${LEGACY_OPT}"; then 500 echo " exportPATH_KBUILD=${KBUILD_PATH}"501 echo " exportBUILD_TYPE=${KBUILD_TYPE}"502 echo " exportBUILD_PLATFORM=${KBUILD_HOST}"503 echo " exportBUILD_PLATFORM_ARCH=${KBUILD_HOST_ARCH}"504 echo " exportBUILD_PLATFORM_CPU=${KBUILD_HOST_CPU}"505 echo " exportBUILD_TARGET=${KBUILD_TARGET}"506 echo " exportBUILD_TARGET_ARCH=${KBUILD_TARGET_ARCH}"507 echo " exportBUILD_TARGET_CPU=${KBUILD_TARGET_CPU}"530 echo "${EVAL_EXPORT} PATH_KBUILD=${KBUILD_PATH}" 531 echo "${EVAL_EXPORT} BUILD_TYPE=${KBUILD_TYPE}" 532 echo "${EVAL_EXPORT} BUILD_PLATFORM=${KBUILD_HOST}" 533 echo "${EVAL_EXPORT} BUILD_PLATFORM_ARCH=${KBUILD_HOST_ARCH}" 534 echo "${EVAL_EXPORT} BUILD_PLATFORM_CPU=${KBUILD_HOST_CPU}" 535 echo "${EVAL_EXPORT} BUILD_TARGET=${KBUILD_TARGET}" 536 echo "${EVAL_EXPORT} BUILD_TARGET_ARCH=${KBUILD_TARGET_ARCH}" 537 echo "${EVAL_EXPORT} BUILD_TARGET_CPU=${KBUILD_TARGET_CPU}" 508 538 fi 509 539 fi … … 511 541 # Export variables. 512 542 export PATH 543 test -n "${FULL_OPT}" -o "${EXP_TYPE_OPT}" && export KBUILD_TYPE 513 544 if test -n "${FULL_OPT}"; then 514 545 export KBUILD_PATH 515 export KBUILD_TYPE516 546 export KBUILD_HOST 517 547 export KBUILD_HOST_ARCH
Note:
See TracChangeset
for help on using the changeset viewer.