Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jun 1st, 2013  |  syntax: None  |  size: 2.87 KB  |  views: 4  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. DESCRIPTION = "The Low Level Virtual Machine"
  2. HOMEPAGE = "http://llvm.org"
  3. # 3-clause BSD-like
  4. LICENSE = "NCSA"
  5. LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=60fdd7739841f04a2ce2171a726be8f3"
  6.  
  7. DEPENDS = "libffi llvm-common"
  8.  
  9. SRC_URI = "http://llvm.org/releases/${PV}/llvm-${PV}.src.tar.gz"
  10. SRC_URI_append_libc-uclibc = " file://arm_fenv_uclibc.patch "
  11.  
  12. SRC_URI[md5sum] = "71610289bbc819e3e15fdd562809a2d7"
  13. SRC_URI[sha256sum] = "125090c4d26740f1d5e9838477c931ed7d9ad70d599ba265f46f3a42cb066343"
  14.  
  15. S = "${WORKDIR}/llvm-${PV}.src"
  16.  
  17. inherit autotools perlnative pythonnative
  18.  
  19. LLVM_ARCH = "${@get_llvm_arch(d)}"
  20. LLVM_BUILD_DIR = "${WORKDIR}/llvm-${PV}.build"
  21. LLVM_RELEASE = "3.2"
  22.  
  23. EXTRA_OECONF += "--disable-assertions \
  24.                  --enable-debug-runtime \
  25.                  --disable-expensive-checks \
  26.                  --enable-bindings=none \
  27.                  --enable-keep-symbols \
  28.                  --enable-libffi \
  29.                  --enable-optimized \
  30.                  --enable-shared \
  31.                  --enable-targets=${LLVM_ARCH}"
  32. EXTRA_OEMAKE += "REQUIRES_RTTI=1"
  33. FILES_${PN} += "${libdir}/lib*.so"
  34. FILES_${PN}-dev += "${bindir} \
  35.                     ${libdir}/BugpointPasses.so \
  36.                     ${libdir}/LLVMHello.so"
  37. FILES_SOLIBSDEV = ""
  38.  
  39. do_configure_prepend() {
  40.         # Remove RPATHs
  41.         sed -i 's:$(RPATH) -Wl,$(\(ToolDir\|LibDir\|ExmplDir\))::g' Makefile.rules
  42.  
  43.         # Drop "svn" suffix from version string
  44.         sed -i 's/3\.2svn/3.2/g' configure
  45.  
  46.         # Fails to build unless using separate directory from source
  47.         mkdir -p ${LLVM_BUILD_DIR}
  48.         cd ${LLVM_BUILD_DIR}
  49. }
  50.  
  51. do_compile() {
  52.         cd ${LLVM_BUILD_DIR}
  53.         oe_runmake CC=${BUILD_CC} CXX=${BUILD_CXX} cross-compile-build-tools
  54.         oe_runmake
  55. }
  56.  
  57. do_install() {
  58.         cd ${LLVM_BUILD_DIR}
  59.         autotools_do_install
  60.         install -d ${D}${docdir}
  61.         mv ${D}${prefix}/docs/* ${D}${docdir}
  62.         rmdir ${D}${prefix}/docs
  63.         mv ${D}${bindir}/${HOST_SYS}-llvm-config-host ${LLVM_BUILD_DIR}/llvm-config-host
  64. }
  65.  
  66. SYSROOT_PREPROCESS_FUNCS += "llvm_sysroot_preprocess"
  67.  
  68. llvm_sysroot_preprocess() {
  69.         install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}
  70.         install -m 0755 ${LLVM_BUILD_DIR}/llvm-config-host ${SYSROOT_DESTDIR}${bindir_crossscripts}/llvm-config${LLVM_RELEASE}
  71. }
  72.  
  73. def get_llvm_arch(d):
  74.     import bb;
  75.  
  76.     arch = bb.data.getVar('TARGET_ARCH', d, 1)
  77.  
  78.     if arch == "x86_64" or arch == "i486" or arch == "i586" or arch == "i686":
  79.         arch = "x86"
  80.     elif arch == "x86_64":
  81.         arch = "x86_64"
  82.     elif arch == "arm":
  83.         arch = "arm"
  84.     elif arch == "mipsel" or arch == "mips":
  85.         arch = "mips"
  86.     elif arch == "powerpc" or arch == "powerpc64":
  87.         arch = "powerpc"
  88.     else:
  89.         bb.warn("%s does not support %s yet" % (bb.data.getVar('PN', d, 1), arch) );
  90.  
  91.     return arch
clone this paste RAW Paste Data