Back to index

enigmail  1.4.3
Functions | Variables
build-gcc Namespace Reference

Functions

def download_uri
def extract
def check_run
def run_in
def patch
def build_package
def build_aux_tools
def with_env
def build_glibc
def build_glibc_aux
def build_linux_headers_aux
def build_linux_headers
def build_gcc
def build_one_stage
def build_one_stage_aux
def build_tar_package
def build_source_dir

Variables

string base_dir = "/builds/slave/moz-toolchain"
string source_dir = "/src"
string build_dir = "/build"
string aux_inst_dir = '/aux_inst'
string old_make = '/bin/make'
string binutils_version = "2.21.1"
string glibc_version = "2.5.1"
string linux_version = "2.6.18"
string tar_version = "1.26"
string make_version = "3.81"
string gcc_version = "4.5.2"
string mpfr_version = "2.4.2"
string gmp_version = "5.0.1"
string mpc_version = "0.8.1"
string unifdef_version = "2.6"
string binutils_source_uri = "http://ftp.gnu.org/gnu/binutils/binutils-%sa.tar.bz2"
string glibc_source_uri = "http://ftp.gnu.org/gnu/glibc/glibc-%s.tar.bz2"
string linux_source_uri = "http://www.kernel.org/pub/linux/kernel/v2.6/linux-%s.tar.bz2"
string tar_source_uri = "http://ftp.gnu.org/gnu/tar/tar-%s.tar.bz2"
string make_source_uri = "http://ftp.gnu.org/gnu/make/make-%s.tar.bz2"
string unifdef_source_uri = "http://dotat.at/prog/unifdef/unifdef-%s.tar.gz"
string gcc_source_uri = "http://ftp.gnu.org/gnu/gcc/gcc-%s/gcc-%s.tar.bz2"
string mpfr_source_uri = "http://www.mpfr.org/mpfr-%s/mpfr-%s.tar.bz2"
string gmp_source_uri = "http://ftp.gnu.org/gnu/gmp/gmp-%s.tar.bz2"
string mpc_source_uri = "http://www.multiprecision.org/mpc/download/mpc-%s.tar.gz"
tuple binutils_source_tar = download_uri(binutils_source_uri)
tuple glibc_source_tar = download_uri(glibc_source_uri)
tuple linux_source_tar = download_uri(linux_source_uri)
tuple tar_source_tar = download_uri(tar_source_uri)
tuple make_source_tar = download_uri(make_source_uri)
tuple unifdef_source_tar = download_uri(unifdef_source_uri)
tuple mpc_source_tar = download_uri(mpc_source_uri)
tuple mpfr_source_tar = download_uri(mpfr_source_uri)
tuple gmp_source_tar = download_uri(gmp_source_uri)
tuple gcc_source_tar = download_uri(gcc_source_uri)
tuple binutils_source_dir = build_source_dir('binutils-', binutils_version)
tuple glibc_source_dir = build_source_dir('glibc-', glibc_version)
tuple linux_source_dir = build_source_dir('linux-', linux_version)
tuple tar_source_dir = build_source_dir('tar-', tar_version)
tuple make_source_dir = build_source_dir('make-', make_version)
tuple unifdef_source_dir = build_source_dir('unifdef-', unifdef_version)
tuple mpc_source_dir = build_source_dir('mpc-', mpc_version)
tuple mpfr_source_dir = build_source_dir('mpfr-', mpfr_version)
tuple gmp_source_dir = build_source_dir('gmp-', gmp_version)
tuple gcc_source_dir = build_source_dir('gcc-', gcc_version)
string stage1_dir = '/stage1'
string stage1_tool_inst_dir = '/inst'
string stage2_dir = '/stage2'

Function Documentation

def build-gcc.build_aux_tools (   base_dir)

Definition at line 57 of file build-gcc.py.

00057 
00058 def build_aux_tools(base_dir):
00059     make_build_dir = base_dir + '/make_build'
00060     build_package(make_source_dir, make_build_dir,
00061                   ["--prefix=%s" % aux_inst_dir], "make")
00062 
00063     run_in(unifdef_source_dir, ["make"])
00064     run_in(unifdef_source_dir, ["make", "prefix=%s" % aux_inst_dir, "install"])
00065 
00066     tar_build_dir = base_dir + '/tar_build'
00067     build_package(tar_source_dir, tar_build_dir,
00068                   ["--prefix=%s" % aux_inst_dir])

Here is the call graph for this function:

def build-gcc.build_gcc (   stage_dir,
  is_stage_one 
)

Definition at line 102 of file build-gcc.py.

00102 
00103 def build_gcc(stage_dir, is_stage_one):
00104     gcc_build_dir = stage_dir + '/gcc'
00105     tool_inst_dir = stage_dir + '/inst'
00106     lib_inst_dir = stage_dir + '/libinst'
00107     gcc_configure_args = ["--prefix=%s" % tool_inst_dir,
00108                           "--enable-__cxa_atexit",
00109                           "--with-gmp=%s" % lib_inst_dir,
00110                           "--with-mpfr=%s" % lib_inst_dir,
00111                           "--with-mpc=%s" % lib_inst_dir,
00112                           "--enable-languages=c,c++",
00113                           "--disable-multilib",
00114                           "--disable-bootstrap"]
00115     if is_stage_one:
00116         # We build the stage1 gcc without shared libraries. Otherwise its
00117         # libgcc.so would depend on the system libc.so, which causes problems
00118         # when it tries to use that libgcc.so and the libc we are about to
00119         # build.
00120         gcc_configure_args.append("--disable-shared")
00121 
00122     build_package(gcc_source_dir, gcc_build_dir, gcc_configure_args)
00123 
00124     if is_stage_one:
00125         # The glibc build system uses -lgcc_eh, but at least in this setup
00126         # libgcc.a has all it needs.
00127         d = tool_inst_dir + "/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/"
00128         os.symlink(d + "libgcc.a", d + "libgcc_eh.a")

Here is the call graph for this function:

Here is the caller graph for this function:

def build-gcc.build_glibc (   env,
  stage_dir,
  inst_dir 
)

Definition at line 76 of file build-gcc.py.

00076 
00077 def build_glibc(env, stage_dir, inst_dir):
00078     def f():
00079         build_glibc_aux(stage_dir, inst_dir)
00080     with_env(env, f)

Here is the call graph for this function:

Here is the caller graph for this function:

def build-gcc.build_glibc_aux (   stage_dir,
  inst_dir 
)

Definition at line 81 of file build-gcc.py.

00081 
00082 def build_glibc_aux(stage_dir, inst_dir):
00083     glibc_build_dir = stage_dir + '/glibc'
00084     build_package(glibc_source_dir, glibc_build_dir,
00085                   ["--disable-profile",
00086                    "--enable-add-ons=nptl",
00087                    "--without-selinux",
00088                    "--enable-kernel=%s" % linux_version,
00089                    "--libdir=%s/lib64" % inst_dir,
00090                    "--prefix=%s" % inst_dir])

Here is the call graph for this function:

Here is the caller graph for this function:

def build-gcc.build_linux_headers (   inst_dir)

Definition at line 97 of file build-gcc.py.

00097 
00098 def build_linux_headers(inst_dir):
00099     def f():
00100         build_linux_headers_aux(inst_dir)
00101     with_env({"PATH" : aux_inst_dir + "/bin:%s" % os.environ["PATH"]}, f)

Here is the call graph for this function:

Here is the caller graph for this function:

def build-gcc.build_linux_headers_aux (   inst_dir)

Definition at line 91 of file build-gcc.py.

00091 
00092 def build_linux_headers_aux(inst_dir):
00093     run_in(linux_source_dir, [old_make, "headers_check"])
00094     run_in(linux_source_dir, [old_make, "INSTALL_HDR_PATH=dest",
00095                                "headers_install"])
00096     shutil.move(linux_source_dir + "/dest", inst_dir)

Here is the call graph for this function:

Here is the caller graph for this function:

def build-gcc.build_one_stage (   env,
  stage_dir,
  is_stage_one 
)

Definition at line 129 of file build-gcc.py.

00129 
00130 def build_one_stage(env, stage_dir, is_stage_one):
00131     def f():
00132         build_one_stage_aux(stage_dir, is_stage_one)
00133     with_env(env, f)

Here is the call graph for this function:

def build-gcc.build_one_stage_aux (   stage_dir,
  is_stage_one 
)

Definition at line 134 of file build-gcc.py.

00134 
00135 def build_one_stage_aux(stage_dir, is_stage_one):
00136     os.mkdir(stage_dir)
00137 
00138     lib_inst_dir = stage_dir + '/libinst'
00139 
00140     gmp_build_dir = stage_dir + '/gmp'
00141     build_package(gmp_source_dir, gmp_build_dir,
00142                   ["--prefix=%s" % lib_inst_dir, "--disable-shared"])
00143     mpfr_build_dir = stage_dir + '/mpfr'
00144     build_package(mpfr_source_dir, mpfr_build_dir,
00145                   ["--prefix=%s" % lib_inst_dir, "--disable-shared",
00146                    "--with-gmp=%s" % lib_inst_dir])
00147     mpc_build_dir = stage_dir + '/mpc'
00148     build_package(mpc_source_dir, mpc_build_dir,
00149                   ["--prefix=%s" % lib_inst_dir, "--disable-shared",
00150                    "--with-gmp=%s" % lib_inst_dir,
00151                    "--with-mpfr=%s" % lib_inst_dir])
00152 
00153     tool_inst_dir = stage_dir + '/inst'
00154     build_linux_headers(tool_inst_dir)
00155 
00156     binutils_build_dir = stage_dir + '/binutils'
00157     build_package(binutils_source_dir, binutils_build_dir,
00158                   ["--prefix=%s" % tool_inst_dir])
00159 
00160     # During stage one we have to build gcc first, this glibc doesn't even
00161     # build with gcc 4.6. During stage two, we have to build glibc first.
00162     # The problem is that libstdc++ is built with xgcc and if glibc has
00163     # not been built yet xgcc will use the system one.
00164     if is_stage_one:
00165         build_gcc(stage_dir, is_stage_one)
00166         build_glibc({"CC"  : tool_inst_dir + "/bin/gcc",
00167                      "CXX" : tool_inst_dir + "/bin/g++"},
00168                     stage_dir, tool_inst_dir)
00169     else:
00170         build_glibc({}, stage_dir, tool_inst_dir)
00171         build_gcc(stage_dir, is_stage_one)

Here is the call graph for this function:

Here is the caller graph for this function:

def build-gcc.build_package (   package_source_dir,
  package_build_dir,
  configure_args,
  make = old_make 
)

Definition at line 50 of file build-gcc.py.

00050 
00051                    make = old_make):
00052     os.mkdir(package_build_dir)
00053     run_in(package_build_dir,
00054            ["%s/configure" % package_source_dir] + configure_args)
00055     run_in(package_build_dir, [make, "-j8"])
00056     run_in(package_build_dir, [make, "install"])

Here is the call graph for this function:

Here is the caller graph for this function:

def build-gcc.build_source_dir (   prefix,
  version 
)

Definition at line 179 of file build-gcc.py.

00179 
00180 def build_source_dir(prefix, version):
00181     return source_dir + '/' + prefix + version

def build-gcc.build_tar_package (   tar,
  name,
  base,
  directory 
)

Definition at line 172 of file build-gcc.py.

00172 
00173 def build_tar_package(tar, name, base, directory):
00174     name = os.path.realpath(name)
00175     run_in(base, [tar, "-cf", name, "--mtime=2012-01-01", "--owner=root",
00176                   directory])

Here is the call graph for this function:

def build-gcc.check_run (   args)

Definition at line 34 of file build-gcc.py.

00034 
00035 def check_run(args):
00036     r = subprocess.call(args)
00037     assert r == 0

Here is the caller graph for this function:

def build-gcc.download_uri (   uri)

Definition at line 23 of file build-gcc.py.

00023 
00024 def download_uri(uri):
00025     fname = uri.split('/')[-1]
00026     if (os.path.exists(fname)):
00027         return fname
00028     urllib.urlretrieve(uri, fname)
00029     return fname

def build-gcc.extract (   tar,
  path 
)

Definition at line 30 of file build-gcc.py.

00030 
00031 def extract(tar, path):
00032     t = tarfile.open(tar)
00033     t.extractall(path)

def build-gcc.patch (   patch,
  plevel,
  srcdir 
)

Definition at line 44 of file build-gcc.py.

00044 
00045 def patch(patch, plevel, srcdir):
00046     patch = os.path.realpath(patch)
00047     check_run(['patch', '-d', srcdir, '-p%s' % plevel, '-i', patch, '--fuzz=0',
00048                '-s'])

Here is the call graph for this function:

def build-gcc.run_in (   path,
  args 
)

Definition at line 38 of file build-gcc.py.

00038 
00039 def run_in(path, args):
00040     d = os.getcwd()
00041     os.chdir(path)
00042     check_run(args)
00043     os.chdir(d)

Here is the call graph for this function:

Here is the caller graph for this function:

def build-gcc.with_env (   env,
  f 
)

Definition at line 69 of file build-gcc.py.

00069 
00070 def with_env(env, f):
00071     old_env = os.environ.copy()
00072     os.environ.update(env)
00073     f()
00074     os.environ.clear()
00075     os.environ.update(old_env)

Here is the caller graph for this function:


Variable Documentation

string build-gcc.aux_inst_dir = '/aux_inst'

Definition at line 11 of file build-gcc.py.

string build-gcc.base_dir = "/builds/slave/moz-toolchain"

Definition at line 7 of file build-gcc.py.

tuple build-gcc.binutils_source_dir = build_source_dir('binutils-', binutils_version)

Definition at line 224 of file build-gcc.py.

tuple build-gcc.binutils_source_tar = download_uri(binutils_source_uri)

Definition at line 213 of file build-gcc.py.

string build-gcc.binutils_source_uri = "http://ftp.gnu.org/gnu/binutils/binutils-%sa.tar.bz2"

Definition at line 193 of file build-gcc.py.

string build-gcc.binutils_version = "2.21.1"

Definition at line 182 of file build-gcc.py.

string build-gcc.build_dir = "/build"

Definition at line 10 of file build-gcc.py.

tuple build-gcc.gcc_source_dir = build_source_dir('gcc-', gcc_version)

Definition at line 233 of file build-gcc.py.

tuple build-gcc.gcc_source_tar = download_uri(gcc_source_uri)

Definition at line 222 of file build-gcc.py.

string build-gcc.gcc_source_uri = "http://ftp.gnu.org/gnu/gcc/gcc-%s/gcc-%s.tar.bz2"

Definition at line 205 of file build-gcc.py.

string build-gcc.gcc_version = "4.5.2"

Definition at line 187 of file build-gcc.py.

tuple build-gcc.glibc_source_dir = build_source_dir('glibc-', glibc_version)

Definition at line 225 of file build-gcc.py.

tuple build-gcc.glibc_source_tar = download_uri(glibc_source_uri)

Definition at line 214 of file build-gcc.py.

string build-gcc.glibc_source_uri = "http://ftp.gnu.org/gnu/glibc/glibc-%s.tar.bz2"

Definition at line 195 of file build-gcc.py.

string build-gcc.glibc_version = "2.5.1"

Definition at line 183 of file build-gcc.py.

tuple build-gcc.gmp_source_dir = build_source_dir('gmp-', gmp_version)

Definition at line 232 of file build-gcc.py.

tuple build-gcc.gmp_source_tar = download_uri(gmp_source_uri)

Definition at line 221 of file build-gcc.py.

string build-gcc.gmp_source_uri = "http://ftp.gnu.org/gnu/gmp/gmp-%s.tar.bz2"

Definition at line 209 of file build-gcc.py.

string build-gcc.gmp_version = "5.0.1"

Definition at line 189 of file build-gcc.py.

tuple build-gcc.linux_source_dir = build_source_dir('linux-', linux_version)

Definition at line 226 of file build-gcc.py.

tuple build-gcc.linux_source_tar = download_uri(linux_source_uri)

Definition at line 215 of file build-gcc.py.

string build-gcc.linux_source_uri = "http://www.kernel.org/pub/linux/kernel/v2.6/linux-%s.tar.bz2"

Definition at line 197 of file build-gcc.py.

string build-gcc.linux_version = "2.6.18"

Definition at line 184 of file build-gcc.py.

tuple build-gcc.make_source_dir = build_source_dir('make-', make_version)

Definition at line 228 of file build-gcc.py.

tuple build-gcc.make_source_tar = download_uri(make_source_uri)

Definition at line 217 of file build-gcc.py.

string build-gcc.make_source_uri = "http://ftp.gnu.org/gnu/make/make-%s.tar.bz2"

Definition at line 201 of file build-gcc.py.

string build-gcc.make_version = "3.81"

Definition at line 186 of file build-gcc.py.

tuple build-gcc.mpc_source_dir = build_source_dir('mpc-', mpc_version)

Definition at line 230 of file build-gcc.py.

tuple build-gcc.mpc_source_tar = download_uri(mpc_source_uri)

Definition at line 219 of file build-gcc.py.

string build-gcc.mpc_source_uri = "http://www.multiprecision.org/mpc/download/mpc-%s.tar.gz"

Definition at line 210 of file build-gcc.py.

string build-gcc.mpc_version = "0.8.1"

Definition at line 190 of file build-gcc.py.

tuple build-gcc.mpfr_source_dir = build_source_dir('mpfr-', mpfr_version)

Definition at line 231 of file build-gcc.py.

tuple build-gcc.mpfr_source_tar = download_uri(mpfr_source_uri)

Definition at line 220 of file build-gcc.py.

string build-gcc.mpfr_source_uri = "http://www.mpfr.org/mpfr-%s/mpfr-%s.tar.bz2"

Definition at line 207 of file build-gcc.py.

string build-gcc.mpfr_version = "2.4.2"

Definition at line 188 of file build-gcc.py.

string build-gcc.old_make = '/bin/make'

Definition at line 12 of file build-gcc.py.

string build-gcc.source_dir = "/src"

Definition at line 9 of file build-gcc.py.

string build-gcc.stage1_dir = '/stage1'

Definition at line 262 of file build-gcc.py.

string build-gcc.stage1_tool_inst_dir = '/inst'

Definition at line 265 of file build-gcc.py.

string build-gcc.stage2_dir = '/stage2'

Definition at line 266 of file build-gcc.py.

tuple build-gcc.tar_source_dir = build_source_dir('tar-', tar_version)

Definition at line 227 of file build-gcc.py.

tuple build-gcc.tar_source_tar = download_uri(tar_source_uri)

Definition at line 216 of file build-gcc.py.

string build-gcc.tar_source_uri = "http://ftp.gnu.org/gnu/tar/tar-%s.tar.bz2"

Definition at line 199 of file build-gcc.py.

string build-gcc.tar_version = "1.26"

Definition at line 185 of file build-gcc.py.

tuple build-gcc.unifdef_source_dir = build_source_dir('unifdef-', unifdef_version)

Definition at line 229 of file build-gcc.py.

tuple build-gcc.unifdef_source_tar = download_uri(unifdef_source_uri)

Definition at line 218 of file build-gcc.py.

string build-gcc.unifdef_source_uri = "http://dotat.at/prog/unifdef/unifdef-%s.tar.gz"

Definition at line 203 of file build-gcc.py.

string build-gcc.unifdef_version = "2.6"

Definition at line 191 of file build-gcc.py.