This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jun 4th, 2013  |  syntax: Bash  |  size: 3.59 KB  |  views: 2  |  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=d0a3ef0d3e0e8f5cf59e5ffc273ab1f8"
  6.  
  7. DEPENDS = "libffi llvm-common valgrind-native"
  8.  
  9. SRC_URI = "http://llvm.org/pre-releases/${PV}/rc2/llvm-${PV}rc2-source.tar.gz"
  10. SRC_URI_append_libc-uclibc = " file://arm_fenv_uclibc.patch "
  11.  
  12. SRC_URI[md5sum] = "063396afe869f515abbdb76673d22b69"
  13. SRC_URI[sha256sum] = "8f44002fa49e360b5c5bb808dd241d5e77cc9c149acdd97081f2a8fb3d4d1c52"
  14.  
  15. S = "${WORKDIR}/llvm.src"
  16.  
  17. inherit autotools perlnative pythonnative
  18.  
  19. LLVM_BUILD_DIR = "${WORKDIR}/llvm-${PV}.build"
  20. LLVM_INSTALL_DIR = "${WORKDIR}/llvm-install"
  21. LLVM_RELEASE = "3.3"
  22. LLVM_DIR = "llvm${LLVM_RELEASE}"
  23.  
  24. EXTRA_OECONF += "--disable-assertions \
  25.                 --enable-debug-runtime \
  26.                 --disable-expensive-checks \
  27.                 --enable-bindings=none \
  28.                 --enable-keep-symbols \
  29.                 --enable-libffi \
  30.                 --enable-optimized \
  31.                 --enable-shared \
  32.                 --enable-targets=host-only"
  33. EXTRA_OEMAKE += "REQUIRES_RTTI=1"
  34. FILES_${PN} = "${libdir}/lib*.so \
  35.               ${libdir}/${LLVM_DIR}/*"
  36. FILES_${PN}-dbg = "${bindir}/${LLVM_DIR}/.debug \
  37.                   ${libdir}/${LLVM_DIR}/.debug \
  38.                   ${libdir}/.debug \
  39.                   /usr/src/debug"
  40. FILES_${PN}-dev = "${bindir}/${LLVM_DIR} \
  41.                   ${includedir}/${LLVM_DIR} \
  42.                   ${libdir}/${LLVM_DIR}/BugpointPasses.so \
  43.                   ${libdir}/${LLVM_DIR}/LLVMHello.so"
  44. FILES_${PN}-static-dev = "${libdir}/${LLVM_DIR}/*.a"
  45. FILES_SOLIBSDEV = ""
  46. INSANE_SKIP_${PN} = "dev-so"
  47.  
  48. do_configure_prepend() {
  49.         # Remove RPATHs
  50.         sed -i 's:$(RPATH) -Wl,$(\(ToolDir\|LibDir\|ExmplDir\))::g' Makefile.rules
  51.  
  52.         # Fix paths in llvm-config
  53.         sed -i "s|sys::path::parent_path(CurrentPath))|sys::path::parent_path(sys::path::parent_path(CurrentPath)))|g" tools/llvm-config/llvm-config.cpp
  54.         sed -i "s|/bin|/bin/${LLVM_DIR}|g" tools/llvm-config/llvm-config.cpp
  55.         sed -i "s|/include|/include/${LLVM_DIR}|g" tools/llvm-config/llvm-config.cpp
  56.         sed -i "s|/lib|/lib/${LLVM_DIR}|g" tools/llvm-config/llvm-config.cpp
  57.  
  58.         # Fails to build unless using separate directory from source
  59.         mkdir -p ${LLVM_BUILD_DIR}
  60.         cd ${LLVM_BUILD_DIR}
  61. }
  62.  
  63. do_compile() {
  64.         cd ${LLVM_BUILD_DIR}
  65.         oe_runmake CC=${BUILD_CC} CXX=${BUILD_CXX} cross-compile-build-tools
  66.         oe_runmake
  67. }
  68.  
  69. do_install() {
  70.         cd ${LLVM_BUILD_DIR}
  71.         oe_runmake DESTDIR=${LLVM_INSTALL_DIR} install
  72.  
  73.         mv ${LLVM_INSTALL_DIR}${bindir}/${HOST_SYS}-llvm-config-host ${LLVM_INSTALL_DIR}/llvm-config-host
  74.  
  75.         install -d ${D}${bindir}/${LLVM_DIR}
  76.         mv ${LLVM_INSTALL_DIR}${bindir}/* ${D}${bindir}/${LLVM_DIR}/
  77.  
  78.         install -d ${D}${includedir}/${LLVM_DIR}
  79.         mv ${LLVM_INSTALL_DIR}${includedir}/* ${D}${includedir}/${LLVM_DIR}/
  80.  
  81.         install -d ${D}${libdir}/${LLVM_DIR}
  82.         mv ${LLVM_INSTALL_DIR}${libdir}/* ${D}${libdir}/${LLVM_DIR}/
  83.         ln -s ${LLVM_DIR}/libLLVM-${LLVM_RELEASE}.so ${D}${libdir}/libLLVM-${LLVM_RELEASE}.so
  84.  
  85.         install -d ${D}${docdir}/${LLVM_DIR}
  86.         mv ${LLVM_INSTALL_DIR}${prefix}/docs/llvm/* ${D}${docdir}/${LLVM_DIR}
  87. }
  88.  
  89. SYSROOT_PREPROCESS_FUNCS += "llvm_sysroot_preprocess"
  90.  
  91. llvm_sysroot_preprocess() {
  92.         install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}
  93.         mv ${LLVM_INSTALL_DIR}/llvm-config-host ${SYSROOT_DESTDIR}${bindir_crossscripts}/llvm-config${LLVM_RELEASE}
  94. }
clone this paste RAW Paste Data