Allow to store working files outside the build tree (eg. incase the working tree is on the network).
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue Jun 24 16:19:45 2008 +0000 (2008-06-24)
changeset 610254083a796a8
parent 609 dc9314e3d72d
child 611 eac4dc8da8a9
Allow to store working files outside the build tree (eg. incase the working tree is on the network).

/trunk/scripts/crosstool.sh | 9 5 4 0 +++++----
/trunk/config/global/paths.in | 23 22 1 0 ++++++++++++++++++++++-
2 files changed, 27 insertions(+), 5 deletions(-)
config/global/paths.in
scripts/crosstool.sh
     1.1 --- a/config/global/paths.in	Tue Jun 24 15:44:55 2008 +0000
     1.2 +++ b/config/global/paths.in	Tue Jun 24 16:19:45 2008 +0000
     1.3 @@ -19,6 +19,27 @@
     1.4        If you say 'y' here, new downloaded tarballs will be saved in the
     1.5        directory you entered above.
     1.6  
     1.7 +config WORK_DIR
     1.8 +    string
     1.9 +    prompt "Working directory"
    1.10 +    default "${CT_TOP_DIR}/targets"
    1.11 +    help
    1.12 +      Set this to the directory where all build actions will be done.
    1.13 +      
    1.14 +      The default is "${CT_TOP_DIR}/targets", and leaving this option
    1.15 +      empty will also use the default.
    1.16 +      
    1.17 +      You should not need to change that, except in one very peculiar
    1.18 +      setup:
    1.19 +       - your crosstool-NG source directory is on the network
    1.20 +       - you configured crosstool-NG with --local
    1.21 +      This kind of setup is a pain, as any action involving source file
    1.22 +      access would have to go through the wire. In this case, you should
    1.23 +      set CT_WORK_DIR to point to a path local to your machine, to avoid
    1.24 +      any network overhead.
    1.25 +      
    1.26 +      Do *NOT* change it if you don't know better.
    1.27 +
    1.28  config PREFIX_DIR
    1.29      string
    1.30      prompt "Prefix directory"
    1.31 @@ -31,7 +52,7 @@
    1.32  #    prompt "Install directory"
    1.33      default "${CT_PREFIX_DIR}"
    1.34  #    help
    1.35 -#      This is the path the target will be installed into.
    1.36 +#      This is the path the toolchain will be installed into.
    1.37  #      
    1.38  #      Normally, you would set this to ${CT_PREFIX_DIR}, but if for some reasons
    1.39  #      you can't write there, you can install somewhere else and have a third
     2.1 --- a/scripts/crosstool.sh	Tue Jun 24 15:44:55 2008 +0000
     2.2 +++ b/scripts/crosstool.sh	Tue Jun 24 16:19:45 2008 +0000
     2.3 @@ -86,15 +86,16 @@
     2.4  CT_LIBC_FILE="${CT_LIBC}-${CT_LIBC_VERSION}"
     2.5  
     2.6  # Where will we work?
     2.7 -CT_TARBALLS_DIR="${CT_TOP_DIR}/targets/tarballs"
     2.8 -CT_SRC_DIR="${CT_TOP_DIR}/targets/src"
     2.9 -CT_BUILD_DIR="${CT_TOP_DIR}/targets/${CT_TARGET}/build"
    2.10 +: "${CT_WORK_DIR:=${CT_TOP_DIR}/targets}"
    2.11 +CT_TARBALLS_DIR="${CT_WORK_DIR}/tarballs"
    2.12 +CT_SRC_DIR="${CT_WORK_DIR}/src"
    2.13 +CT_BUILD_DIR="${CT_WORK_DIR}/${CT_TARGET}/build"
    2.14  CT_DEBUG_INSTALL_DIR="${CT_INSTALL_DIR}/${CT_TARGET}/debug-root"
    2.15  # Note: we'll always install the core compiler in its own directory, so as to
    2.16  # not mix the two builds: core and final.
    2.17  CT_CC_CORE_STATIC_PREFIX_DIR="${CT_BUILD_DIR}/${CT_CC}-core-static"
    2.18  CT_CC_CORE_SHARED_PREFIX_DIR="${CT_BUILD_DIR}/${CT_CC}-core-shared"
    2.19 -CT_STATE_DIR="${CT_TOP_DIR}/targets/${CT_TARGET}/state"
    2.20 +CT_STATE_DIR="${CT_WORK_DIR}/${CT_TARGET}/state"
    2.21  
    2.22  # We must ensure that we can restart if asked for!
    2.23  if [ -n "${CT_RESTART}" -a ! -d "${CT_STATE_DIR}"  ]; then