diff options
author | Stefan Schmidt <stefan@datenfreihafen.org> | 2009-03-23 11:45:40 +0100 |
---|---|---|
committer | Stefan Schmidt <stefan@datenfreihafen.org> | 2009-03-23 11:45:40 +0100 |
commit | 451b1c687105655a4f2c9c477b05535041e25060 (patch) | |
tree | 3db315590172cd6244107a97a6603add934d7e32 /recipes/llvm/llvm_2.5.bb | |
parent | 6767ca50430e37cdad0a8992b73c3f82ead134bf (diff) | |
parent | e2b99b79f516a7466dc050902cee62f39869bf9d (diff) |
Merge branch 'org.openembedded.dev' of git@git.openembedded.net:openembedded into org.openembedded.dev
Diffstat (limited to 'recipes/llvm/llvm_2.5.bb')
-rw-r--r-- | recipes/llvm/llvm_2.5.bb | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/recipes/llvm/llvm_2.5.bb b/recipes/llvm/llvm_2.5.bb new file mode 100644 index 0000000000..c0ce3345b8 --- /dev/null +++ b/recipes/llvm/llvm_2.5.bb @@ -0,0 +1,65 @@ +# TODO: +# - packages examples +# - fix staging (and probably llvm-config script) + +DESCRIPTION = "The Low Level Virtual Machine" +HOMEPAGE = "http://llvm.org" +LICENSE = "various" + +SRC_URI = "\ + http://llvm.org/releases/${PV}/llvm-${PV}.tar.gz \ + file://fix-build.patch;patch=1 \ +" + +DEPENDS = "llvm-native" + +inherit cmake + +OECMAKE_SOURCEPATH = ".." +OECMAKE_BUILDPATH = "build" +EXTRA_OEMAKE = "-C build" +EXTRA_OECMAKE = "\ + -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/tblgen \ + -DLLVM_TARGETS_TO_BUILD=${@get_llvm_arch(d)} \ + -DCMAKE_LINKER:FILEPATH=${LD} \ + -DCMAKE_AR:FILEPATH=${AR} \ + -DCMAKE_OBJCOPY:FILEPATH=${OBJCOPY} \ + -DCMAKE_OBJDUMP:FILEPATH=${OBJDUMP} \ + -DCMAKE_RANLIB:FILEPATH=${RANLIB} \ + -DCMAKE_STRIP:FILEPATH=${STRIP} \ +" + +do_stage() { + oe_runmake DESTDIR="${STAGE_TEMP}" install + + install -d ${STAGING_BINDIR_CROSS} + + # Fix some paths in the script to make it work correctly + sed -e's^my.*ABS_RUN_DIR =.*^my $ABS_RUN_DIR = "${STAGING_DIR_TARGET}";^' \ + -e's^my.*INCLUDEDIR =.*^my $INCLUDEDIR = "${STAGING_INCDIR}";^' \ + -e's^my.*LIBDIR.*^my $LIBDIR = "${STAGING_LIBDIR}";^' \ + -e's^my.*BINDIR.*^my $BINDIR = "${STAGING_BINDIR}";^' \ + build/bin/llvm-config > ${STAGING_BINDIR_CROSS}/llvm-config + + chmod +x ${STAGING_BINDIR_CROSS}/llvm-config +} + +# Retrieve the target in a way that is compatible to the arch +# value in llvm (>= 2.5) +def get_llvm_arch(d): + import bb; + + arch = bb.data.getVar('TARGET_ARCH', d, 1) + if arch == "x86_64" or arch == "i486" or arch == "i586" or arch == "i686": + arch = "X86" + elif arch == "arm": + arch = "ARM" + elif arch == "mipsel": + arch = "Mips" + elif arch == "powerpc": + arch = "PowerPC" + else: + oefatal("Your target architecture is not supported by this recipe"); + + return arch + |