diff options
Diffstat (limited to 'classes/icecc.bbclass')
| -rw-r--r-- | classes/icecc.bbclass | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/classes/icecc.bbclass b/classes/icecc.bbclass index 0eb2d9feee..cd5a25bf28 100644 --- a/classes/icecc.bbclass +++ b/classes/icecc.bbclass @@ -33,10 +33,8 @@ def icc_determine_gcc_version(gcc): 'i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5363)' """ - import os return os.popen("%s --version" % gcc ).readline().split()[2] - def create_cross_env(bb,d): """ Create a tar.bz2 of the current toolchain @@ -47,8 +45,9 @@ def create_cross_env(bb,d): if len(prefix) == 0: return "" - import tarfile, socket, time, os - ice_dir = bb.data.expand('${CROSS_DIR}', d) + import tarfile, socket, time + ice_dir = bb.data.expand('${STAGING_DIR_NATIVE}${prefix_native}/${BASE_PACKAGE_ARCH}', d) + staging_dir = bb.data.expand('${STAGING_DIR_TARGET}', d) prefix = bb.data.expand('${HOST_PREFIX}' , d) distro = bb.data.expand('${DISTRO}', d) target_sys = bb.data.expand('${TARGET_SYS}', d) @@ -59,13 +58,12 @@ def create_cross_env(bb,d): # Stupid check to determine if we have built a libc and a cross # compiler. try: - os.stat(os.path.join(ice_dir, target_sys, 'lib', 'libstdc++.so')) - os.stat(os.path.join(ice_dir, target_sys, 'bin', 'g++')) + os.stat(os.path.join(staging_dir, 'usr', 'lib', 'libstdc++.so')) + os.stat(os.path.join(ice_dir, 'bin', "%s-g++" % target_sys)) except: # no cross compiler built yet - bb.error('no cross compiler built yet?') return "" - VERSION = icc_determine_gcc_version( os.path.join(ice_dir,target_sys,"bin","g++") ) + VERSION = icc_determine_gcc_version( os.path.join(ice_dir,"bin","%s-g++" % target_sys) ) cross_name = prefix + distro + "-" + target_sys + "-" + float + "-" + VERSION + "-" + name tar_file = os.path.join(ice_dir, 'ice', cross_name + '.tar.gz') @@ -97,8 +95,8 @@ def create_cross_env(bb,d): def create_native_env(bb,d): - import tarfile, socket, time, os - ice_dir = bb.data.expand('${CROSS_DIR}', d) + import tarfile, socket, time + ice_dir = bb.data.expand('${STAGING_DIR_NATIVE}${prefix_native}/${BASE_PACKAGE_ARCH}', d) prefix = bb.data.expand('${HOST_PREFIX}' , d) distro = bb.data.expand('${DISTRO}', d) target_sys = bb.data.expand('${TARGET_SYS}', d) @@ -144,8 +142,8 @@ def get_cross_kernel_cc(bb,d): def create_cross_kernel_env(bb,d): - import tarfile, socket, time, os - ice_dir = bb.data.expand('${CROSS_DIR}', d) + import tarfile, socket, time + ice_dir = bb.data.expand('${STAGING_DIR_NATIVE}${prefix_native}/${BASE_PACKAGE_ARCH}', d) prefix = bb.data.expand('${HOST_PREFIX}' , d) distro = bb.data.expand('${DISTRO}', d) target_sys = bb.data.expand('${TARGET_SYS}', d) @@ -159,11 +157,10 @@ def create_cross_kernel_env(bb,d): try: os.stat(os.path.join(ice_dir, 'bin', kernel_cc)) except: # no cross compiler built yet - bb.error('no kernel cross compiler built yet') return "" VERSION = icc_determine_gcc_version( os.path.join(ice_dir,"bin",kernel_cc) ) - cross_name = prefix + distro + "-" + target_sys + "-" + float + "-" + VERSION + "-" + name + cross_name = prefix + distro + "-kernel-" + target_sys + "-" + float + "-" + VERSION + "-" + name tar_file = os.path.join(ice_dir, 'ice', cross_name + '.tar.gz') try: @@ -210,8 +207,6 @@ def create_path(compilers, type, bb, d): """ Create Symlinks for the icecc in the staging directory """ - import os - staging = os.path.join(bb.data.expand('${STAGING_DIR}', d), "ice", type) #check if the icecc path is set by the user @@ -256,14 +251,15 @@ def icc_path(bb,d): #"system" package blacklist contains a list of packages that can not distribute compile tasks #for one reason or the other - system_package_blacklist = [ "uclibc", "glibc", "gcc", "qemu", "bind", "u-boot", "dhcp-forwarder", "enchant", "connman" ] + system_package_blacklist = [ "uclibc", "glibc", "gcc", "bind", "u-boot", "dhcp-forwarder", "enchant", "connman" ] user_package_blacklist = (bb.data.getVar('ICECC_USER_PACKAGE_BL', d) or "").split() package_blacklist = system_package_blacklist + user_package_blacklist for black in package_blacklist: if black in package_tmp: bb.note(package_tmp, ' found in blacklist, disable icecc') - bb.data.setVar("PARALLEL_MAKE" , "", d) + fallback_parallel = bb.data.getVar('ICECC_FALLBACK_PARALLEL', d) or "" + bb.data.setVar("PARALLEL_MAKE", fallback_parallel, d) return "" prefix = bb.data.expand('${HOST_PREFIX}', d) @@ -324,3 +320,7 @@ do_configure_prepend() { do_compile_prepend() { set_icecc_env } + +do_install_prepend() { + set_icecc_env +} |
