# HG changeset patch # User "Yann E. MORIN" # Date 1208126762 0 # Node ID f1326505e3e53013cf625defde87176c97a552cd # Parent 14a3d24927dc52051a1d466f21adf193d66d14c7 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(+) diff -r 14a3d24927dc -r f1326505e3e5 config/global.in --- a/config/global.in Sun Apr 13 18:25:30 2008 +0000 +++ b/config/global.in Sun Apr 13 22:46:02 2008 +0000 @@ -246,6 +246,60 @@ Usefull to pre-retrieve the tarballs before going off-line. +choice + bool + prompt "Proxy type" + default USE_NO_PROXY + +config USE_NO_PROXY + bool + prompt "No proxy" + help + Select this option if you have a direct connection to the internet, + or if you already set the environment adequately. + +config USE_HTTP_PROXY + bool + prompt "HTTP proxy" + help + Use an HTTP proxy to connect to to the internet. + Onlt the http and ftp protocols will be tunneled through this + proxy. + + Alternatively to setting this options, you can set and export + the following variable in your environment: + ftp_proxy=http://user:passwd@proxy.server:port/ + http_proxy=http://user:passwd@proxy.server:port/ + https_proxy=http://user:passwd@proxy.server:port/ + +# Haha! Here is an interesting feature/bug of mconf! +# The following config entries will be shown out-side the +# choice menu! +# To add a third entry in the choice menu, add it after the +# if...endif conditional below, and so on for a fourth entry... +if USE_HTTP_PROXY + +config HTTP_PROXY_HOST + string + prompt "HTTP proxy hostname/IP" + +config HTTP_PROXY_PORT + int + prompt "HTTP proxy port" + +config HTTP_PROXY_USER + string + prompt "HTTP proxy user name" + +config HTTP_PROXY_PASSWD + string + prompt "HTTP proxy password" + +endif # USE_HTTP_PROXY + +endchoice + +# Force restore indentation config FOOBAR if ! ONLY_DOWNLOAD diff -r 14a3d24927dc -r f1326505e3e5 scripts/crosstool.sh --- a/scripts/crosstool.sh Sun Apr 13 18:25:30 2008 +0000 +++ b/scripts/crosstool.sh Sun Apr 13 22:46:02 2008 +0000 @@ -307,6 +307,20 @@ [ ${CT_PARALLEL_JOBS} -ne 0 ] && PARALLELMFLAGS="${PARALLELMFLAGS} -j${CT_PARALLEL_JOBS}" [ ${CT_LOAD} -ne 0 ] && PARALLELMFLAGS="${PARALLELMFLAGS} -l${CT_LOAD}" + # Set environment for proxy access + if [ "${CT_USE_HTTP_PROXY}" = "y" ]; then + http_proxy="http://" + case "${CT_HTTP_PROXY_USER}:${CT_HTTP_PROXY_PASSWD}" in + :) ;; + :*) http_proxy="${http_proxy}:${CT_HTP_PROXY_PASSWD}@";; + *:) http_proxy="${http_proxy}${CT_HTTP_PROXY_USER}@";; + *:*) http_proxy="${http_proxy}${CT_HTTP_PROXY_USER}:${CT_HTP_PROXY_PASSWD}@";; + esac + export http_proxy="${http_proxy}${HTTP_PROXY_HOST}:${HTTP_PROXY_PORT}/" + export https_proxy="${http_proxy}" + export ftp_proxy="${http_proxy}" + fi + CT_DoStep EXTRA "Dumping internal crosstool-NG configuration" CT_DoLog EXTRA "Building a toolchain for:" CT_DoLog EXTRA " build = ${CT_BUILD}"