Allow using an HTTP proxy to tunnel FTP and HTTP requests.
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Apr 13 22:46:02 2008 +0000 (2008-04-13)
changeset 441f1326505e3e5
parent 440 14a3d24927dc
child 442 ab046c11fbf7
Allow using an HTTP proxy to tunnel FTP and HTTP requests.

scripts/crosstool.sh | 14 14 0 0 +++++++++++++
config/global.in | 54 54 0 0 +++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 68 insertions(+)
config/global.in
scripts/crosstool.sh
     1.1 --- a/config/global.in	Sun Apr 13 18:25:30 2008 +0000
     1.2 +++ b/config/global.in	Sun Apr 13 22:46:02 2008 +0000
     1.3 @@ -246,6 +246,60 @@
     1.4        
     1.5        Usefull to pre-retrieve the tarballs before going off-line.
     1.6  
     1.7 +choice
     1.8 +    bool
     1.9 +    prompt "Proxy type"
    1.10 +    default USE_NO_PROXY
    1.11 +
    1.12 +config USE_NO_PROXY
    1.13 +    bool
    1.14 +    prompt "No proxy"
    1.15 +    help
    1.16 +      Select this option if you have a direct connection to the internet,
    1.17 +      or if you already set the environment adequately.
    1.18 +
    1.19 +config USE_HTTP_PROXY
    1.20 +    bool
    1.21 +    prompt "HTTP proxy"
    1.22 +    help
    1.23 +      Use an HTTP proxy to connect to to the internet.
    1.24 +      Onlt the http and ftp protocols will be tunneled through this
    1.25 +      proxy.
    1.26 +
    1.27 +      Alternatively to setting this options, you can set and export
    1.28 +      the following variable in your environment:
    1.29 +        ftp_proxy=http://user:passwd@proxy.server:port/
    1.30 +        http_proxy=http://user:passwd@proxy.server:port/
    1.31 +        https_proxy=http://user:passwd@proxy.server:port/
    1.32 +
    1.33 +# Haha! Here is an interesting feature/bug of mconf!
    1.34 +# The following config entries will be shown out-side the
    1.35 +# choice menu!
    1.36 +# To add a third entry in the choice menu, add it after the
    1.37 +# if...endif conditional below, and so on for a fourth entry...
    1.38 +if USE_HTTP_PROXY
    1.39 +
    1.40 +config HTTP_PROXY_HOST
    1.41 +    string
    1.42 +    prompt "HTTP proxy hostname/IP"
    1.43 +
    1.44 +config HTTP_PROXY_PORT
    1.45 +    int
    1.46 +    prompt "HTTP proxy port"
    1.47 +    
    1.48 +config HTTP_PROXY_USER
    1.49 +    string
    1.50 +    prompt "HTTP proxy user name"
    1.51 +
    1.52 +config HTTP_PROXY_PASSWD
    1.53 +    string
    1.54 +    prompt "HTTP proxy password"
    1.55 +
    1.56 +endif # USE_HTTP_PROXY
    1.57 +
    1.58 +endchoice
    1.59 +
    1.60 +# Force restore indentation
    1.61  config FOOBAR
    1.62  
    1.63  if ! ONLY_DOWNLOAD
     2.1 --- a/scripts/crosstool.sh	Sun Apr 13 18:25:30 2008 +0000
     2.2 +++ b/scripts/crosstool.sh	Sun Apr 13 22:46:02 2008 +0000
     2.3 @@ -307,6 +307,20 @@
     2.4      [ ${CT_PARALLEL_JOBS} -ne 0 ] && PARALLELMFLAGS="${PARALLELMFLAGS} -j${CT_PARALLEL_JOBS}"
     2.5      [ ${CT_LOAD} -ne 0 ] && PARALLELMFLAGS="${PARALLELMFLAGS} -l${CT_LOAD}"
     2.6  
     2.7 +    # Set environment for proxy access
     2.8 +    if [ "${CT_USE_HTTP_PROXY}" = "y" ]; then
     2.9 +      http_proxy="http://"
    2.10 +      case  "${CT_HTTP_PROXY_USER}:${CT_HTTP_PROXY_PASSWD}" in
    2.11 +        :)      ;;
    2.12 +        :*)     http_proxy="${http_proxy}:${CT_HTP_PROXY_PASSWD}@";;
    2.13 +        *:)     http_proxy="${http_proxy}${CT_HTTP_PROXY_USER}@";;
    2.14 +        *:*)    http_proxy="${http_proxy}${CT_HTTP_PROXY_USER}:${CT_HTP_PROXY_PASSWD}@";;
    2.15 +      esac
    2.16 +      export http_proxy="${http_proxy}${HTTP_PROXY_HOST}:${HTTP_PROXY_PORT}/"
    2.17 +      export https_proxy="${http_proxy}"
    2.18 +      export ftp_proxy="${http_proxy}"
    2.19 +    fi
    2.20 +
    2.21      CT_DoStep EXTRA "Dumping internal crosstool-NG configuration"
    2.22      CT_DoLog EXTRA "Building a toolchain for:"
    2.23      CT_DoLog EXTRA "  build  = ${CT_BUILD}"