diff options
author | Robert Schuster <thebohemian@gmx.net> | 2009-03-31 11:51:10 +0200 |
---|---|---|
committer | Robert Schuster <thebohemian@gmx.net> | 2009-03-31 11:55:05 +0200 |
commit | 8db75a24a2f7d0af4bac46e69535733a203226c2 (patch) | |
tree | 8c34f03d1828b2be5f725eaa220ce7aca7f54675 | |
parent | 7ac3d6c5fa717dbd30b523e2259f20ced8d0f253 (diff) |
llvm: Reworked to allow multiple installation of same version.
- introduced common include file
- provided implementation for llvm 2.5
- added wrapper script and its build recipe
- the same for native side
llvm2.5 2.5: New recipe
llvm2.5-native 2.5: New recipe.
llvm-common: New recipe.
llvm-common-native: New recipe.
-rw-r--r-- | recipes/llvm/llvm-common-native.bb | 12 | ||||
-rw-r--r-- | recipes/llvm/llvm-common.bb | 14 | ||||
-rw-r--r-- | recipes/llvm/llvm-common/llvm-config | 10 | ||||
-rw-r--r-- | recipes/llvm/llvm-native.inc | 26 | ||||
-rw-r--r-- | recipes/llvm/llvm2.5-native_2.5.bb | 4 | ||||
-rw-r--r-- | recipes/llvm/llvm2.5/fix-build.patch (renamed from recipes/llvm/llvm-2.5/fix-build.patch) | 0 | ||||
-rw-r--r-- | recipes/llvm/llvm2.5_2.5.bb | 4 | ||||
-rw-r--r-- | recipes/llvm/llvm_2.5.bb | 67 |
8 files changed, 70 insertions, 67 deletions
diff --git a/recipes/llvm/llvm-common-native.bb b/recipes/llvm/llvm-common-native.bb new file mode 100644 index 0000000000..c2b79bd6a5 --- /dev/null +++ b/recipes/llvm/llvm-common-native.bb @@ -0,0 +1,12 @@ +require llvm-common.bb + +inherit native + +do_install() { + : +} + +do_stage() { + install -d ${STAGING_BINDIR} + install -m 0755 ${WORKDIR}/llvm-config ${STAGING_BINDIR} +} diff --git a/recipes/llvm/llvm-common.bb b/recipes/llvm/llvm-common.bb new file mode 100644 index 0000000000..b7f2bfc011 --- /dev/null +++ b/recipes/llvm/llvm-common.bb @@ -0,0 +1,14 @@ +DESCRIPTION = "Helper script for OE's llvm support" + +SRC_URI = "file://llvm-config" + +PACKAGES = "" + +do_install() { + : +} + +do_stage() { + install -d ${STAGING_BINDIR_CROSS} + install -m 0755 ${WORKDIR}/llvm-config ${STAGING_BINDIR_CROSS} +} diff --git a/recipes/llvm/llvm-common/llvm-config b/recipes/llvm/llvm-common/llvm-config new file mode 100644 index 0000000000..5256b8cd06 --- /dev/null +++ b/recipes/llvm/llvm-common/llvm-config @@ -0,0 +1,10 @@ +#!/bin/sh +# Wrapper script for real llvm-config. Simply calls + +if [ $WANT_LLVM_RELEASE ]; then + exec `dirname $0`/llvm-config$WANT_LLVM_RELEASE ${@} +else + echo "The variable WANT_LLVM_RELEASE is not defined and exported" + echo "by your build recipe. Go figure." + exit 1 +fi diff --git a/recipes/llvm/llvm-native.inc b/recipes/llvm/llvm-native.inc new file mode 100644 index 0000000000..a7d7fa3830 --- /dev/null +++ b/recipes/llvm/llvm-native.inc @@ -0,0 +1,26 @@ +require llvm.inc + +DEPENDS = "llvm-common-native" + +inherit native + +# the difference to the non-native build is that we do not need +# to declare the location of the tblgen executable. +EXTRA_OECMAKE = "\ + -DLLVM_TARGETS_TO_BUILD=${LLVM_ARCH} \ + -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() { + llvm_stage + + install -d ${STAGING_BINDIR} + install -m 0755 build/bin/llvm-config${LLVM_RELEASE} ${STAGING_BINDIR} +} + + diff --git a/recipes/llvm/llvm2.5-native_2.5.bb b/recipes/llvm/llvm2.5-native_2.5.bb new file mode 100644 index 0000000000..13b5a446b7 --- /dev/null +++ b/recipes/llvm/llvm2.5-native_2.5.bb @@ -0,0 +1,4 @@ +require llvm-native.inc + +SRC_URI += "file://fix-build.patch;patch=1" + diff --git a/recipes/llvm/llvm-2.5/fix-build.patch b/recipes/llvm/llvm2.5/fix-build.patch index 527823c18c..527823c18c 100644 --- a/recipes/llvm/llvm-2.5/fix-build.patch +++ b/recipes/llvm/llvm2.5/fix-build.patch diff --git a/recipes/llvm/llvm2.5_2.5.bb b/recipes/llvm/llvm2.5_2.5.bb new file mode 100644 index 0000000000..355634e0fa --- /dev/null +++ b/recipes/llvm/llvm2.5_2.5.bb @@ -0,0 +1,4 @@ +require llvm.inc + +SRC_URI += "file://fix-build.patch;patch=1" + diff --git a/recipes/llvm/llvm_2.5.bb b/recipes/llvm/llvm_2.5.bb deleted file mode 100644 index ece64422b5..0000000000 --- a/recipes/llvm/llvm_2.5.bb +++ /dev/null @@ -1,67 +0,0 @@ -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 \ -" - -PR = "r2" - -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="${STAGING_DIR_HOST}" install - - install -d ${STAGING_INCDIR}/llvm - find include/llvm -name "*.h" -maxdepth 1 -exec \ - install {} ${STAGING_INCDIR}/llvm \; - - 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 - |