All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-oe][PATCH 0/4] llvm cleanup
@ 2013-07-06 19:33 Martin Jansa
  2013-07-06 19:33 ` [meta-oe][PATCH 1/4] llvm: Consolidate .inc files Martin Jansa
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Martin Jansa @ 2013-07-06 19:33 UTC (permalink / raw)
  To: openembedded-devel

The following changes since commit 1cd30e7929f3cdfd2d97db2888d1bcb5e165d546:

  busybox: Follow OE-Core update to 1.12.1 version (2013-07-06 00:38:05 +0200)

are available in the git repository at:

  git://git.openembedded.org/meta-openembedded-contrib jansa/llvm
  http://cgit.openembedded.org/cgit.cgi/meta-openembedded-contrib/log/?h=jansa/deps

Martin Jansa (4):
  llvm: Consolidate .inc files
  llvm2: don't install llvm-config to bindir
  llvm: use newer class-native overrides instead of virtclass
  llvm: split packages a bit more

 meta-oe/recipes-core/llvm/llvm-common.bb |   2 +-
 meta-oe/recipes-core/llvm/llvm.inc       | 224 +++++--------------------------
 meta-oe/recipes-core/llvm/llvm2.8_2.8.bb |   9 +-
 meta-oe/recipes-core/llvm/llvm2.9_2.9.bb |  30 +----
 meta-oe/recipes-core/llvm/llvm2.inc      | 175 ++++++++++++++++++++++++
 meta-oe/recipes-core/llvm/llvm3.2_3.2.bb | 104 +-------------
 meta-oe/recipes-core/llvm/llvm3.3_3.3.bb | 100 +-------------
 meta-oe/recipes-core/llvm/llvm3.inc      |  80 +++++++++++
 8 files changed, 299 insertions(+), 425 deletions(-)
 create mode 100644 meta-oe/recipes-core/llvm/llvm2.inc
 create mode 100644 meta-oe/recipes-core/llvm/llvm3.inc

-- 
1.8.2.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [meta-oe][PATCH 1/4] llvm: Consolidate .inc files
  2013-07-06 19:33 [meta-oe][PATCH 0/4] llvm cleanup Martin Jansa
@ 2013-07-06 19:33 ` Martin Jansa
  2013-07-06 19:33 ` [meta-oe][PATCH 2/4] llvm2: don't install llvm-config to bindir Martin Jansa
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Martin Jansa @ 2013-07-06 19:33 UTC (permalink / raw)
  To: openembedded-devel

* unlike other recipes where we have a rule to keep only one
  version, llvm is different so we'll keep .inc files
* llvm.inc is shared by all, llvm[23].inc are separated because
  2.* is built with cmake and 3.* with automake
* fix staticdev packaging and move it to shared llvm.inc
  FILES_${PN}-static-dev = "${libdir}/${LLVM_DIR}/*.a"
  (it's staticdev not static-dev)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta-oe/recipes-core/llvm/llvm.inc       | 210 ++-----------------------------
 meta-oe/recipes-core/llvm/llvm2.8_2.8.bb |   9 +-
 meta-oe/recipes-core/llvm/llvm2.9_2.9.bb |  30 +----
 meta-oe/recipes-core/llvm/llvm2.inc      | 194 ++++++++++++++++++++++++++++
 meta-oe/recipes-core/llvm/llvm3.2_3.2.bb | 104 +--------------
 meta-oe/recipes-core/llvm/llvm3.3_3.3.bb | 100 +--------------
 meta-oe/recipes-core/llvm/llvm3.inc      |  84 +++++++++++++
 7 files changed, 303 insertions(+), 428 deletions(-)
 create mode 100644 meta-oe/recipes-core/llvm/llvm2.inc
 create mode 100644 meta-oe/recipes-core/llvm/llvm3.inc

diff --git a/meta-oe/recipes-core/llvm/llvm.inc b/meta-oe/recipes-core/llvm/llvm.inc
index fcd2666..20588f3 100644
--- a/meta-oe/recipes-core/llvm/llvm.inc
+++ b/meta-oe/recipes-core/llvm/llvm.inc
@@ -19,208 +19,24 @@
 
 DESCRIPTION = "The Low Level Virtual Machine"
 HOMEPAGE = "http://llvm.org"
+
 # 3-clause BSD-like
+# University of Illinois/NCSA Open Source License
 LICENSE = "NCSA"
-LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=0ac5f799a2d89477c75b0a378b221855"
-
-DEPENDS = "llvm${LLVM_RELEASE}-native llvm-common"
-DEPENDS_virtclass-native = "llvm-common-native cmake-native"
-
-INC_PR = "r2"
-
-SRC_URI = "http://llvm.org/releases/${PV}/llvm-${PV}.tgz"
-
-S = "${WORKDIR}/llvm-${PV}"
-
-inherit cmake perlnative pythonnative
+LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=d0a3ef0d3e0e8f5cf59e5ffc273ab1f8"
 
-# Defines the LLVM supported arches. By now we always build either for ${BUILD}
-# (native) or ${TARGET}. In the future it may make sense to enable all backends
-# for the non-native build. The decision which backends are used is made by
-# the 3rd party program or library that uses llvm anyway.
-LLVM_ARCH = "${@get_llvm_arch(d)}"
+# 2.* inherits also cmake
+# 3.* inherits also automake
+inherit perlnative pythonnative
 
-# This is used for generating the install directory for the llvm libraries,
-# binaries and headers. It makes side by side installation of those possible.
 LLVM_RELEASE = "${PV}"
+LLVM_DIR = "llvm${LLVM_RELEASE}"
 
-# llvm *must* be built out of tree
-OECMAKE_SOURCEPATH = ".."
-OECMAKE_BUILDPATH = "build"
-EXTRA_OECMAKE = "\
-    -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm${LLVM_RELEASE}/tblgen \
-    -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} \
-    -DNM_PATH:FILEPATH=${NM} \
-    -DLLVM_ENABLE_PIC:BOOL=ON \
-    -DLLVM_TARGET_ARCH:STRING=${LLVM_ARCH} \
-    -DLLVM_ENABLE_ASSERTIONS:BOOL=ON \
-    -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
-    -DBUILD_SHARED_LIBS:BOOL=ON \
-    -DCMAKE_SKIP_BUILD_RPATH:BOOL=ON \
+FILES_${PN}-dbg += "${bindir}/${LLVM_DIR}/.debug \
+                    ${libdir}/${LLVM_DIR}/.debug \
 "
-# We need to reset this to avoid breakage as we build out of tree
-TOOLCHAIN_OPTIONS = ""
-
-PACKAGES_DYNAMIC = "llvm-*"
-
-# the difference to the non-native build is that we do not need
-# to declare the location of the tblgen executable.
-EXTRA_OECMAKE_virtclass-native = "\
-    -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} \
-    -DNM_PATH:FILEPATH=${NM} \
+FILES_${PN}-dev += "${bindir} \
+                    ${libdir}/${LLVM_DIR}/BugpointPasses.so \
+                    ${libdir}/${LLVM_DIR}/LLVMHello.so \
 "
-
-PACKAGES_virtclass-native = ""
-
-PACKAGES_DYNAMIC_virtclass-native = ""
-
-python populate_packages_prepend () {
-    libllvm_libdir = bb.data.expand('${libdir}/llvm${LLVM_RELEASE}', d)
-    do_split_packages(d, libllvm_libdir, '^lib(.*)\.so$', 'libllvm-%s', 'Split package for %s', allow_dirs=True)
-}
-
-FILES_${PN} = ""
-ALLOW_EMPTY_${PN} = "1"
-
-FILES_${PN}-dbg += "${libdir}/llvm${LLVM_RELEASE}/.debug ${bindir}/llvm${LLVM_RELEASE}/.debug"
-
-FILES_${PN}-dev = " \
-                   ${includedir} \
-                   ${bindir}/* \
-                   ${libdir}/llvm${LLVM_RELEASE}/LLVMHello.so \
-                   ${libdir}/llvm${LLVM_RELEASE}/BugpointPasses.so \
-                   ${libdir}/llvm${LLVM_RELEASE}/*.a \
-"
-
-base_do_compile_prepend() {
-    # Avoid *** No rule to make target `native/bin/tblgen', needed by `include/llvm/Intrinsics.gen.tmp'
-    oe_runmake tblgen
-}
-
-do_install() {
-    # Install into a private directory to be able to reorganize the files.
-
-    cd ${OECMAKE_BUILDPATH}
-
-    oe_runmake DESTDIR=${WORKDIR}/llvm-install install
-
-    # Create our custom target directories
-    install -d ${D}${bindir}/llvm${LLVM_RELEASE}
-    install -d ${D}${includedir}/llvm${LLVM_RELEASE}
-    install -d ${D}${libdir}/llvm${LLVM_RELEASE}
-
-    #    Move headers into their own directory
-    cp -R ${WORKDIR}/llvm-install/${prefix}/include/llvm \
-    ${D}${includedir}/llvm${LLVM_RELEASE}/
-    cp -R ${WORKDIR}/llvm-install/${prefix}/include/llvm-c \
-    ${D}${includedir}/llvm${LLVM_RELEASE}/
-
-    find ${WORKDIR}/llvm-install/${prefix}/lib -name "*" -maxdepth 1 -exec \
-    install {} ${D}${libdir}/llvm${LLVM_RELEASE} \;
-
-    #    I dont know another way out. Binaries are installed into a special subdir
-    find ${WORKDIR}/llvm-install/${prefix}/bin -name "*" -maxdepth 1 -exec \
-    install {} ${D}${bindir}/llvm${LLVM_RELEASE} \;
-
-    # LLVM does not install this by default.
-    install bin/tblgen ${D}${bindir}/llvm${LLVM_RELEASE}
-
-        # we install it here unmodified for native and none native and overwrite it
-        # later for native case
-        install -d ${D}${bindir}
-        install -m 0755 bin/llvm-config ${D}${bindir}
-}
-
-SYSROOT_PREPROCESS_FUNCS_append_class-target = " llvm_sysroot_preprocess"
-
-llvm_sysroot_preprocess() {
-    cd ${OECMAKE_BUILDPATH}
-
-    # Fix the paths in the config script to make it find the binaries and
-    # library files. Doing so allows 3rd party configure scripts working
-    # unmodified.
-    sed -e's!my.*ABS_RUN_DIR =.*!my $ABS_RUN_DIR = "${STAGING_DIR_TARGET}";!' \
-        -e's!my.*INCLUDEDIR =.*!my $INCLUDEDIR = "${STAGING_INCDIR}/llvm${LLVM_RELEASE}";!' \
-        -e's!my.*LIBDIR.*!my $LIBDIR = "${STAGING_LIBDIR}/llvm${LLVM_RELEASE}";!' \
-        -e's!my.*BINDIR.*!my $BINDIR = "${STAGING_BINDIR}/llvm${LLVM_RELEASE}";!' \
-        bin/llvm-config > bin/llvm-config${LLVM_RELEASE}
-
-        install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}
-        install -m 0755 bin/llvm-config${LLVM_RELEASE} ${SYSROOT_DESTDIR}${bindir_crossscripts}
-}
-
-do_install_virtclass-native() {
-    # Install into a private directory to be able to reorganize the files.
-
-        cd ${OECMAKE_BUILDPATH}
-
-        oe_runmake DESTDIR=${WORKDIR}/llvm-install install
-
-    # Create our custom target directories
-    install -d ${D}${bindir}/llvm${LLVM_RELEASE}
-    install -d ${D}${includedir}/llvm${LLVM_RELEASE}
-    install -d ${D}${libdir}/llvm${LLVM_RELEASE}
-
-    #    Move headers into their own directory
-    cp -R ${WORKDIR}/llvm-install/${prefix}/include/llvm \
-    ${D}${includedir}/llvm${LLVM_RELEASE}/
-    cp -R ${WORKDIR}/llvm-install/${prefix}/include/llvm-c \
-    ${D}${includedir}/llvm${LLVM_RELEASE}/
-
-    find ${WORKDIR}/llvm-install/${prefix}/lib -name "*" -maxdepth 1 -exec \
-    install {} ${D}${libdir}/llvm${LLVM_RELEASE} \;
-
-    #    I dont know another way out. Binaries are installed into a special subdir
-    find ${WORKDIR}/llvm-install/${prefix}/bin -name "*" -maxdepth 1 -exec \
-    install {} ${D}${bindir}/llvm${LLVM_RELEASE} \;
-
-    # LLVM does not install this by default.
-    install bin/tblgen ${D}${bindir}/llvm${LLVM_RELEASE}
-
-    # Fix the paths in the config script to make it find the binaries and
-    # library files. Doing so allows 3rd party configure scripts working
-    # unmodified.
-    sed -e's!my.*ABS_RUN_DIR =.*!my $ABS_RUN_DIR = "${STAGING_DIR_TARGET}";!' \
-        -e's!my.*INCLUDEDIR =.*!my $INCLUDEDIR = "${STAGING_INCDIR}/llvm${LLVM_RELEASE}";!' \
-        -e's!my.*LIBDIR.*!my $LIBDIR = "${STAGING_LIBDIR}/llvm${LLVM_RELEASE}";!' \
-        -e's!my.*BINDIR.*!my $BINDIR = "${STAGING_BINDIR}/llvm${LLVM_RELEASE}";!' \
-        bin/llvm-config > bin/llvm-config${LLVM_RELEASE}
-
-        install -d ${D}${bindir}
-        install -m 0755 bin/llvm-config${LLVM_RELEASE} ${D}${bindir}
-}
-
-
-# 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" or arch == "mips":
-        arch = "mips"
-    elif arch == "powerpc" or arch == "powerpc64":
-        arch = "PowerPC"
-    else:
-        bb.warn("%s does not support %s yet" % (bb.data.getVar('PN', d, 1), arch) );
-
-    return arch
-
-BBCLASSEXTEND = "native"
-
+FILES_${PN}-staticdev = "${libdir}/${LLVM_DIR}/*.a"
diff --git a/meta-oe/recipes-core/llvm/llvm2.8_2.8.bb b/meta-oe/recipes-core/llvm/llvm2.8_2.8.bb
index 8dc22e5..4d0b3c8 100644
--- a/meta-oe/recipes-core/llvm/llvm2.8_2.8.bb
+++ b/meta-oe/recipes-core/llvm/llvm2.8_2.8.bb
@@ -1,10 +1,7 @@
 require llvm.inc
+require llvm2.inc
 
-#LICENSE = "University of Illinois/NCSA Open Source License"
-LICENSE = "NCSA"
-LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=0ac5f799a2d89477c75b0a378b221855"
-
-PR = "${INC_PR}.2"
+PR = "r3"
 
 SRC_URI += " \
             file://30may-llvm2.8-pr399-ppc-arm.patch \
@@ -13,8 +10,6 @@ SRC_URI += " \
             file://llvm-mc_disable.patch \
 "
 
-LLVM_RELEASE = "2.8"
-
 EXTRA_OECMAKE += " -DBUILD_SHARED_LIBS:BOOL=OFF "
 
 SRC_URI[md5sum] = "220d361b4d17051ff4bb21c64abe05ba"
diff --git a/meta-oe/recipes-core/llvm/llvm2.9_2.9.bb b/meta-oe/recipes-core/llvm/llvm2.9_2.9.bb
index 1cd68be..44504b8 100644
--- a/meta-oe/recipes-core/llvm/llvm2.9_2.9.bb
+++ b/meta-oe/recipes-core/llvm/llvm2.9_2.9.bb
@@ -1,9 +1,12 @@
 require llvm.inc
+require llvm2.inc
 
-PR = "${INC_PR}.0"
+PR = "r3"
 
 SRC_URI += "file://0035-gcc-4.7.patch"
 
+ARM_INSTRUCTION_SET = "arm"
+
 # 0019-issue6065.patch is still needed but a bit modified, because it was resolved by
 # http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp?r1=120304&r2=124694&pathrev=124694
 # http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp?diff_format=h&r1=57911&r2=57910&pathrev=57911
@@ -11,33 +14,8 @@ SRC_URI += "file://0035-gcc-4.7.patch"
 # {standard input}:31: Error: invalid register list to push/pop instruction -- `pop {r0,r1,r2,r3,lr}'
 # make[2]: *** [lib/Target/ARM/CMakeFiles/LLVMARMCodeGen.dir/ARMJITInfo.cpp.o] Error 1
 # SRC_URI += "file://0019-issue6065.patch"
-ARM_INSTRUCTION_SET = "arm"
 
 SRC_URI_append_libc-uclibc = " file://arm_fenv_uclibc.patch "
 
-LLVM_EXTRA_ARCH = "X86;"
-LLVM_EXTRA_ARCH_x86 = ""
-LLVM_EXTRA_ARCH_x86-64 = ""
-
-EXTRA_OECMAKE = "\
-    -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm${LLVM_RELEASE}/tblgen \
-    -DLLVM_TARGETS_TO_BUILD="${LLVM_EXTRA_ARCH}${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} \
-    -DNM_PATH:FILEPATH=${NM} \
-    -DLLVM_ENABLE_PIC:BOOL=ON \
-    -DLLVM_TARGET_ARCH:STRING=${LLVM_ARCH} \
-    -DLLVM_ENABLE_ASSERTIONS:BOOL=ON \
-    -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
-    -DBUILD_SHARED_LIBS:BOOL=ON \
-    -DCMAKE_SKIP_BUILD_RPATH:BOOL=ON \
-"
-
-LLVM_RELEASE = "2.9"
-
 SRC_URI[md5sum] = "793138412d2af2c7c7f54615f8943771"
 SRC_URI[sha256sum] = "661236cfa17428b48cfa9cbb9909f7569c64b8ecd219fd91dbc00e3b557b3779"
diff --git a/meta-oe/recipes-core/llvm/llvm2.inc b/meta-oe/recipes-core/llvm/llvm2.inc
new file mode 100644
index 0000000..b5bad45
--- /dev/null
+++ b/meta-oe/recipes-core/llvm/llvm2.inc
@@ -0,0 +1,194 @@
+DEPENDS = "llvm${LLVM_RELEASE}-native llvm-common"
+DEPENDS_virtclass-native = "llvm-common-native cmake-native"
+
+SRC_URI = "http://llvm.org/releases/${PV}/llvm-${PV}.tgz"
+S = "${WORKDIR}/llvm-${PV}"
+
+LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=0ac5f799a2d89477c75b0a378b221855"
+
+inherit cmake
+
+# Defines the LLVM supported arches. By now we always build either for ${BUILD}
+# (native) or ${TARGET}. In the future it may make sense to enable all backends
+# for the non-native build. The decision which backends are used is made by
+# the 3rd party program or library that uses llvm anyway.
+LLVM_ARCH = "${@get_llvm_arch(d)}"
+
+# This is used for generating the install directory for the llvm libraries,
+# binaries and headers. It makes side by side installation of those possible.
+LLVM_RELEASE = "${PV}"
+
+BBCLASSEXTEND = "native"
+
+LLVM_BUILD_DIR = "${B}/build"
+LLVM_INSTALL_DIR = "${B}/llvm-install"
+
+# llvm *must* be built out of tree
+OECMAKE_SOURCEPATH = ".."
+OECMAKE_BUILDPATH = "build"
+
+# other architectures require X86 available,
+LLVM_EXTRA_ARCH = "X86;"
+LLVM_EXTRA_ARCH_x86 = ""
+LLVM_EXTRA_ARCH_x86-64 = ""
+
+EXTRA_OECMAKE = "\
+    -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/${LLVM_DIR}/tblgen \
+    -DLLVM_TARGETS_TO_BUILD="${LLVM_EXTRA_ARCH}${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} \
+    -DNM_PATH:FILEPATH=${NM} \
+    -DLLVM_ENABLE_PIC:BOOL=ON \
+    -DLLVM_TARGET_ARCH:STRING=${LLVM_ARCH} \
+    -DLLVM_ENABLE_ASSERTIONS:BOOL=ON \
+    -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
+    -DBUILD_SHARED_LIBS:BOOL=ON \
+    -DCMAKE_SKIP_BUILD_RPATH:BOOL=ON \
+"
+
+# We need to reset this to avoid breakage as we build out of tree
+TOOLCHAIN_OPTIONS = ""
+
+PACKAGES_DYNAMIC = "llvm-*"
+
+# the difference to the non-native build is that we do not need
+# to declare the location of the tblgen executable.
+EXTRA_OECMAKE_virtclass-native = "\
+    -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} \
+    -DNM_PATH:FILEPATH=${NM} \
+"
+
+PACKAGES_virtclass-native = ""
+
+PACKAGES_DYNAMIC_virtclass-native = ""
+
+python populate_packages_prepend () {
+    libllvm_libdir = bb.data.expand('${libdir}/${LLVM_DIR}', d)
+    do_split_packages(d, libllvm_libdir, '^lib(.*)\.so$', 'libllvm-%s', 'Split package for %s', allow_dirs=True)
+}
+
+FILES_${PN} = ""
+ALLOW_EMPTY_${PN} = "1"
+
+base_do_compile_prepend() {
+    # Avoid *** No rule to make target `native/bin/tblgen', needed by `include/llvm/Intrinsics.gen.tmp'
+    oe_runmake tblgen
+}
+
+do_install() {
+    # Install into a private directory to be able to reorganize the files.
+    cd ${LLVM_BUILD_DIR}
+    oe_runmake DESTDIR=${LLVM_INSTALL_DIR} install
+
+    # Create our custom target directories
+    install -d ${D}${bindir}/${LLVM_DIR}
+    install -d ${D}${includedir}/${LLVM_DIR}
+    install -d ${D}${libdir}/${LLVM_DIR}
+
+    # Move headers into their own directory
+    cp -R ${LLVM_INSTALL_DIR}/${prefix}/include/llvm \
+    ${D}${includedir}/${LLVM_DIR}/
+    cp -R ${LLVM_INSTALL_DIR}/${prefix}/include/llvm-c \
+    ${D}${includedir}/${LLVM_DIR}/
+
+    find ${LLVM_INSTALL_DIR}/${prefix}/lib -name "*" -maxdepth 1 -exec \
+    install {} ${D}${libdir}/${LLVM_DIR} \;
+
+    # I dont know another way out. Binaries are installed into a special subdir
+    find ${LLVM_INSTALL_DIR}/${prefix}/bin -name "*" -maxdepth 1 -exec \
+    install {} ${D}${bindir}/${LLVM_DIR} \;
+
+    # LLVM does not install this by default.
+    install bin/tblgen ${D}${bindir}/${LLVM_DIR}
+
+    # we install it here unmodified for native and none native and overwrite it
+    # later for native case
+    install -d ${D}${bindir}
+    install -m 0755 bin/llvm-config ${D}${bindir}
+}
+
+SYSROOT_PREPROCESS_FUNCS_append_class-target = " llvm_sysroot_preprocess"
+
+llvm_sysroot_preprocess() {
+    cd ${LLVM_BUILD_DIR}
+
+    # Fix the paths in the config script to make it find the binaries and
+    # library files. Doing so allows 3rd party configure scripts working
+    # unmodified.
+    sed -e's!my.*ABS_RUN_DIR =.*!my $ABS_RUN_DIR = "${STAGING_DIR_TARGET}";!' \
+        -e's!my.*INCLUDEDIR =.*!my $INCLUDEDIR = "${STAGING_INCDIR}/${LLVM_DIR}";!' \
+        -e's!my.*LIBDIR.*!my $LIBDIR = "${STAGING_LIBDIR}/${LLVM_DIR}";!' \
+        -e's!my.*BINDIR.*!my $BINDIR = "${STAGING_BINDIR}/${LLVM_DIR}";!' \
+        bin/llvm-config > bin/llvm-config${LLVM_RELEASE}
+
+        install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}
+        install -m 0755 bin/llvm-config${LLVM_RELEASE} ${SYSROOT_DESTDIR}${bindir_crossscripts}
+}
+
+do_install_virtclass-native() {
+    # Install into a private directory to be able to reorganize the files.
+    cd ${LLVM_BUILD_DIR}
+    oe_runmake DESTDIR=${LLVM_INSTALL_DIR} install
+
+    # Create our custom target directories
+    install -d ${D}${bindir}/${LLVM_DIR}
+    install -d ${D}${includedir}/${LLVM_DIR}
+    install -d ${D}${libdir}/${LLVM_DIR}
+
+    # Move headers into their own directory
+    cp -R ${LLVM_INSTALL_DIR}/${prefix}/include/llvm \
+          ${D}${includedir}/${LLVM_DIR}/
+    cp -R ${LLVM_INSTALL_DIR}/${prefix}/include/llvm-c \
+          ${D}${includedir}/${LLVM_DIR}/
+
+    find ${LLVM_INSTALL_DIR}/${prefix}/lib -name "*" -maxdepth 1 -exec \
+        install {} ${D}${libdir}/${LLVM_DIR} \;
+
+    # I dont know another way out. Binaries are installed into a special subdir
+    find ${LLVM_INSTALL_DIR}/${prefix}/bin -name "*" -maxdepth 1 -exec \
+        install {} ${D}${bindir}/${LLVM_DIR} \;
+
+    # LLVM does not install this by default.
+    install bin/tblgen ${D}${bindir}/${LLVM_DIR}
+
+    # Fix the paths in the config script to make it find the binaries and
+    # library files. Doing so allows 3rd party configure scripts working
+    # unmodified.
+    sed -e's!my.*ABS_RUN_DIR =.*!my $ABS_RUN_DIR = "${STAGING_DIR_TARGET}";!' \
+        -e's!my.*INCLUDEDIR =.*!my $INCLUDEDIR = "${STAGING_INCDIR}/${LLVM_DIR}";!' \
+        -e's!my.*LIBDIR.*!my $LIBDIR = "${STAGING_LIBDIR}/${LLVM_DIR}";!' \
+        -e's!my.*BINDIR.*!my $BINDIR = "${STAGING_BINDIR}/${LLVM_DIR}";!' \
+        bin/llvm-config > bin/llvm-config${LLVM_RELEASE}
+
+    install -d ${D}${bindir}
+    install -m 0755 bin/llvm-config${LLVM_RELEASE} ${D}${bindir}
+}
+
+# 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" or arch == "mips":
+        arch = "mips"
+    elif arch == "powerpc" or arch == "powerpc64":
+        arch = "PowerPC"
+    else:
+        bb.warn("%s does not support %s yet" % (bb.data.getVar('PN', d, 1), arch) );
+
+    return arch
diff --git a/meta-oe/recipes-core/llvm/llvm3.2_3.2.bb b/meta-oe/recipes-core/llvm/llvm3.2_3.2.bb
index 71a53c1..48e27b9 100644
--- a/meta-oe/recipes-core/llvm/llvm3.2_3.2.bb
+++ b/meta-oe/recipes-core/llvm/llvm3.2_3.2.bb
@@ -1,105 +1,9 @@
-DESCRIPTION = "The Low Level Virtual Machine"
-HOMEPAGE = "http://llvm.org"
-# 3-clause BSD-like
-LICENSE = "NCSA"
-LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=60fdd7739841f04a2ce2171a726be8f3"
+require llvm.inc
+require llvm3.inc
 
-DEPENDS = "libffi libxml2-native llvm-common"
+# 3.2 is different then 2.8, 2.9 and 3.3
+LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=60fdd7739841f04a2ce2171a726be8f3"
 
-SRC_URI = "http://llvm.org/releases/${PV}/llvm-${PV}.src.tar.gz"
 SRC_URI_append_libc-uclibc = " file://arm_fenv_uclibc.patch "
-
 SRC_URI[md5sum] = "71610289bbc819e3e15fdd562809a2d7"
 SRC_URI[sha256sum] = "125090c4d26740f1d5e9838477c931ed7d9ad70d599ba265f46f3a42cb066343"
-
-S = "${WORKDIR}/llvm-${PV}.src"
-
-inherit autotools perlnative pythonnative
-
-LLVM_BUILD_DIR = "${WORKDIR}/llvm-${PV}.build"
-LLVM_INSTALL_DIR = "${WORKDIR}/llvm-install"
-LLVM_DIR = "llvm${PV}"
-
-EXTRA_OECONF += "--disable-assertions \
-                 --enable-debug-runtime \
-                 --disable-expensive-checks \
-                 --enable-bindings=none \
-                 --enable-keep-symbols \
-                 --enable-libffi \
-                 --enable-optimized \
-                 --enable-shared \
-                 --enable-targets=host-only"
-EXTRA_OEMAKE += "REQUIRES_RTTI=1 VERBOSE=1"
-FILES_${PN} = "${libdir}/lib*.so \
-               ${libdir}/${LLVM_DIR}/*"
-FILES_${PN}-dbg = "${bindir}/${LLVM_DIR}/.debug \
-                   ${libdir}/${LLVM_DIR}/.debug \
-                   ${libdir}/.debug \
-                   /usr/src/debug"
-FILES_${PN}-dev = "${bindir}/${LLVM_DIR} \
-                   ${includedir}/${LLVM_DIR} \
-                   ${libdir}/${LLVM_DIR}/BugpointPasses.so \
-                   ${libdir}/${LLVM_DIR}/LLVMHello.so"
-FILES_${PN}-static-dev = "${libdir}/${LLVM_DIR}/*.a"
-FILES_SOLIBSDEV = ""
-INSANE_SKIP_${PN} = "dev-so"
-
-do_configure_prepend() {
-	# Remove RPATHs
-	sed -i 's:$(RPATH) -Wl,$(\(ToolDir\|LibDir\|ExmplDir\))::g' Makefile.rules
-
-	# Drop "svn" suffix from version string
-	sed -i 's/3\.2svn/3.2/g' configure
-
-	# Fix paths in llvm-config
-	sed -i "s|sys::path::parent_path(CurrentPath))\.str()|sys::path::parent_path(sys::path::parent_path(CurrentPath))).str()|g" tools/llvm-config/llvm-config.cpp
-	sed -ri "s#/(bin|include|lib)(/?\")#/\1/${LLVM_DIR}\2#g" tools/llvm-config/llvm-config.cpp
-
-	# Fails to build unless using separate directory from source
-	mkdir -p ${LLVM_BUILD_DIR}
-	cd ${LLVM_BUILD_DIR}
-}
-
-do_compile() {
-	cd ${LLVM_BUILD_DIR}
-	oe_runmake \
-		AR="${BUILD_AR}" \
-		CC="${BUILD_CC}" \
-		CFLAGS="${BUILD_CFLAGS}" \
-		CXX="${BUILD_CXX}" \
-		CXXFLAGS="${BUILD_CXXFLAGS}" \
-		CPP="${BUILD_CPP}" \
-		CPPFLAGS="${BUILD_CPPFLAGS}" \
-		NM="${BUILD_NM}" \
-		RANLIB="${BUILD_RANLIB}" \
-		PATH="${STAGING_BINDIR_NATIVE}:$PATH" \
-		cross-compile-build-tools
-	oe_runmake
-}
-
-do_install() {
-	cd ${LLVM_BUILD_DIR}
-	oe_runmake DESTDIR=${LLVM_INSTALL_DIR} install
-
-	mv ${LLVM_INSTALL_DIR}${bindir}/${HOST_SYS}-llvm-config-host ${LLVM_INSTALL_DIR}/llvm-config-host
-
-	install -d ${D}${bindir}/${LLVM_DIR}
-	mv ${LLVM_INSTALL_DIR}${bindir}/* ${D}${bindir}/${LLVM_DIR}/
-
-	install -d ${D}${includedir}/${LLVM_DIR}
-	mv ${LLVM_INSTALL_DIR}${includedir}/* ${D}${includedir}/${LLVM_DIR}/
-
-	install -d ${D}${libdir}/${LLVM_DIR}
-	mv ${LLVM_INSTALL_DIR}${libdir}/* ${D}${libdir}/${LLVM_DIR}/
-	ln -s ${LLVM_DIR}/libLLVM-${PV}.so ${D}${libdir}/libLLVM-${PV}.so
-
-	install -d ${D}${docdir}/${LLVM_DIR}
-	mv ${LLVM_INSTALL_DIR}${prefix}/docs/llvm/* ${D}${docdir}/${LLVM_DIR}
-}
-
-SYSROOT_PREPROCESS_FUNCS += "llvm_sysroot_preprocess"
-
-llvm_sysroot_preprocess() {
-	install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}
-	mv ${LLVM_INSTALL_DIR}/llvm-config-host ${SYSROOT_DESTDIR}${bindir_crossscripts}/llvm-config${PV}
-}
diff --git a/meta-oe/recipes-core/llvm/llvm3.3_3.3.bb b/meta-oe/recipes-core/llvm/llvm3.3_3.3.bb
index d3aa963..3fca575 100644
--- a/meta-oe/recipes-core/llvm/llvm3.3_3.3.bb
+++ b/meta-oe/recipes-core/llvm/llvm3.3_3.3.bb
@@ -1,105 +1,9 @@
-DESCRIPTION = "The Low Level Virtual Machine"
-HOMEPAGE = "http://llvm.org"
-# 3-clause BSD-like
-LICENSE = "NCSA"
-LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=d0a3ef0d3e0e8f5cf59e5ffc273ab1f8"
+require llvm.inc
+require llvm3.inc
 
-DEPENDS = "libffi libxml2-native llvm-common"
-
-SRC_URI = "http://llvm.org/releases/${PV}/llvm-${PV}.src.tar.gz"
 SRC_URI_append_libc-uclibc = " file://arm_fenv_uclibc.patch "
-
 SRC_URI[md5sum] = "40564e1dc390f9844f1711c08b08e391"
 SRC_URI[sha256sum] = "68766b1e70d05a25e2f502e997a3cb3937187a3296595cf6e0977d5cd6727578"
 
-S = "${WORKDIR}/llvm-${PV}.src"
-
-inherit autotools perlnative pythonnative
-
-LLVM_BUILD_DIR = "${WORKDIR}/llvm-${PV}.build"
-LLVM_INSTALL_DIR = "${WORKDIR}/llvm-install"
-LLVM_DIR = "llvm${PV}"
-
 PACKAGECONFIG ??= ""
 PACKAGECONFIG[r600] = "--enable-experimental-targets=R600,,,"
-
-EXTRA_OECONF += "--disable-assertions \
-                 --enable-debug-runtime \
-                 --disable-expensive-checks \
-                 --enable-bindings=none \
-                 --enable-keep-symbols \
-                 --enable-libffi \
-                 --enable-optimized \
-                 --enable-shared \
-                 --enable-targets=host-only"
-EXTRA_OEMAKE += "REQUIRES_RTTI=1 VERBOSE=1"
-FILES_${PN} = "${libdir}/lib*.so \
-               ${libdir}/${LLVM_DIR}/*"
-FILES_${PN}-dbg = "${bindir}/${LLVM_DIR}/.debug \
-                   ${libdir}/${LLVM_DIR}/.debug \
-                   ${libdir}/.debug \
-                   /usr/src/debug"
-FILES_${PN}-dev = "${bindir}/${LLVM_DIR} \
-                   ${includedir}/${LLVM_DIR} \
-                   ${libdir}/${LLVM_DIR}/BugpointPasses.so \
-                   ${libdir}/${LLVM_DIR}/LLVMHello.so"
-FILES_${PN}-static-dev = "${libdir}/${LLVM_DIR}/*.a"
-FILES_SOLIBSDEV = ""
-INSANE_SKIP_${PN} = "dev-so"
-
-do_configure_prepend() {
-	# Remove RPATHs
-	sed -i 's:$(RPATH) -Wl,$(\(ToolDir\|LibDir\|ExmplDir\))::g' Makefile.rules
-
-	# Fix paths in llvm-config
-	sed -i "s|sys::path::parent_path(CurrentPath))\.str()|sys::path::parent_path(sys::path::parent_path(CurrentPath))).str()|g" tools/llvm-config/llvm-config.cpp
-	sed -ri "s#/(bin|include|lib)(/?\")#/\1/${LLVM_DIR}\2#g" tools/llvm-config/llvm-config.cpp
-
-	# Fails to build unless using separate directory from source
-	mkdir -p ${LLVM_BUILD_DIR}
-	cd ${LLVM_BUILD_DIR}
-}
-
-do_compile() {
-	cd ${LLVM_BUILD_DIR}
-	oe_runmake \
-		AR="${BUILD_AR}" \
-		CC="${BUILD_CC}" \
-		CFLAGS="${BUILD_CFLAGS}" \
-		CXX="${BUILD_CXX}" \
-		CXXFLAGS="${BUILD_CXXFLAGS}" \
-		CPP="${BUILD_CPP}" \
-		CPPFLAGS="${BUILD_CPPFLAGS}" \
-		NM="${BUILD_NM}" \
-		RANLIB="${BUILD_RANLIB}" \
-		PATH="${STAGING_BINDIR_NATIVE}:$PATH" \
-		cross-compile-build-tools
-	oe_runmake
-}
-
-do_install() {
-	cd ${LLVM_BUILD_DIR}
-	oe_runmake DESTDIR=${LLVM_INSTALL_DIR} install
-
-	mv ${LLVM_INSTALL_DIR}${bindir}/${HOST_SYS}-llvm-config-host ${LLVM_INSTALL_DIR}/llvm-config-host
-
-	install -d ${D}${bindir}/${LLVM_DIR}
-	mv ${LLVM_INSTALL_DIR}${bindir}/* ${D}${bindir}/${LLVM_DIR}/
-
-	install -d ${D}${includedir}/${LLVM_DIR}
-	mv ${LLVM_INSTALL_DIR}${includedir}/* ${D}${includedir}/${LLVM_DIR}/
-
-	install -d ${D}${libdir}/${LLVM_DIR}
-	mv ${LLVM_INSTALL_DIR}${libdir}/* ${D}${libdir}/${LLVM_DIR}/
-	ln -s ${LLVM_DIR}/libLLVM-${PV}.so ${D}${libdir}/libLLVM-${PV}.so
-
-	install -d ${D}${docdir}/${LLVM_DIR}
-	mv ${LLVM_INSTALL_DIR}${prefix}/docs/llvm/* ${D}${docdir}/${LLVM_DIR}
-}
-
-SYSROOT_PREPROCESS_FUNCS += "llvm_sysroot_preprocess"
-
-llvm_sysroot_preprocess() {
-	install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}
-	mv ${LLVM_INSTALL_DIR}/llvm-config-host ${SYSROOT_DESTDIR}${bindir_crossscripts}/llvm-config${PV}
-}
diff --git a/meta-oe/recipes-core/llvm/llvm3.inc b/meta-oe/recipes-core/llvm/llvm3.inc
new file mode 100644
index 0000000..b04fe24
--- /dev/null
+++ b/meta-oe/recipes-core/llvm/llvm3.inc
@@ -0,0 +1,84 @@
+DEPENDS = "libffi libxml2-native llvm-common"
+
+SRC_URI = "http://llvm.org/releases/${PV}/llvm-${PV}.src.tar.gz"
+S = "${WORKDIR}/llvm-${PV}.src"
+
+inherit autotools
+
+LLVM_BUILD_DIR = "${WORKDIR}/llvm-${PV}.build"
+LLVM_INSTALL_DIR = "${WORKDIR}/llvm-install"
+
+EXTRA_OECONF += "--disable-assertions \
+                 --enable-debug-runtime \
+                 --disable-expensive-checks \
+                 --enable-bindings=none \
+                 --enable-keep-symbols \
+                 --enable-libffi \
+                 --enable-optimized \
+                 --enable-shared \
+                 --enable-targets=host-only"
+EXTRA_OEMAKE += "REQUIRES_RTTI=1 VERBOSE=1"
+FILES_${PN} = "${libdir}/lib*.so \
+               ${libdir}/${LLVM_DIR}/*"
+FILES_SOLIBSDEV = ""
+INSANE_SKIP_${PN} = "dev-so"
+
+do_configure_prepend() {
+    # Remove RPATHs
+    sed -i 's:$(RPATH) -Wl,$(\(ToolDir\|LibDir\|ExmplDir\))::g' Makefile.rules
+
+    # Drop "svn" suffix from version string
+    sed -i 's/${PV}svn/${PV}/g' configure
+
+    # Fix paths in llvm-config
+    sed -i "s|sys::path::parent_path(CurrentPath))\.str()|sys::path::parent_path(sys::path::parent_path(CurrentPath))).str()|g" tools/llvm-config/llvm-config.cpp
+    sed -ri "s#/(bin|include|lib)(/?\")#/\1/${LLVM_DIR}\2#g" tools/llvm-config/llvm-config.cpp
+
+    # Fails to build unless using separate directory from source
+    mkdir -p ${LLVM_BUILD_DIR}
+    cd ${LLVM_BUILD_DIR}
+}
+
+do_compile() {
+    cd ${LLVM_BUILD_DIR}
+    oe_runmake \
+        AR="${BUILD_AR}" \
+        CC="${BUILD_CC}" \
+        CFLAGS="${BUILD_CFLAGS}" \
+        CXX="${BUILD_CXX}" \
+        CXXFLAGS="${BUILD_CXXFLAGS}" \
+        CPP="${BUILD_CPP}" \
+        CPPFLAGS="${BUILD_CPPFLAGS}" \
+        NM="${BUILD_NM}" \
+        RANLIB="${BUILD_RANLIB}" \
+        PATH="${STAGING_BINDIR_NATIVE}:$PATH" \
+        cross-compile-build-tools
+    oe_runmake
+}
+
+do_install() {
+    cd ${LLVM_BUILD_DIR}
+    oe_runmake DESTDIR=${LLVM_INSTALL_DIR} install
+
+    mv ${LLVM_INSTALL_DIR}${bindir}/${HOST_SYS}-llvm-config-host ${LLVM_INSTALL_DIR}/llvm-config-host
+
+    install -d ${D}${bindir}/${LLVM_DIR}
+    mv ${LLVM_INSTALL_DIR}${bindir}/* ${D}${bindir}/${LLVM_DIR}/
+
+    install -d ${D}${includedir}/${LLVM_DIR}
+    mv ${LLVM_INSTALL_DIR}${includedir}/* ${D}${includedir}/${LLVM_DIR}/
+
+    install -d ${D}${libdir}/${LLVM_DIR}
+    mv ${LLVM_INSTALL_DIR}${libdir}/* ${D}${libdir}/${LLVM_DIR}/
+    ln -s ${LLVM_DIR}/libLLVM-${PV}.so ${D}${libdir}/libLLVM-${PV}.so
+
+    install -d ${D}${docdir}/${LLVM_DIR}
+    mv ${LLVM_INSTALL_DIR}${prefix}/docs/llvm/* ${D}${docdir}/${LLVM_DIR}
+}
+
+SYSROOT_PREPROCESS_FUNCS += "llvm_sysroot_preprocess"
+
+llvm_sysroot_preprocess() {
+    install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}
+    mv ${LLVM_INSTALL_DIR}/llvm-config-host ${SYSROOT_DESTDIR}${bindir_crossscripts}/llvm-config${PV}
+}
-- 
1.8.2.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [meta-oe][PATCH 2/4] llvm2: don't install llvm-config to bindir
  2013-07-06 19:33 [meta-oe][PATCH 0/4] llvm cleanup Martin Jansa
  2013-07-06 19:33 ` [meta-oe][PATCH 1/4] llvm: Consolidate .inc files Martin Jansa
@ 2013-07-06 19:33 ` Martin Jansa
  2013-07-06 19:33 ` [meta-oe][PATCH 3/4] llvm: use newer class-native overrides instead of virtclass Martin Jansa
  2013-07-06 19:33 ` [meta-oe][PATCH 4/4] llvm: split packages a bit more Martin Jansa
  3 siblings, 0 replies; 5+ messages in thread
From: Martin Jansa @ 2013-07-06 19:33 UTC (permalink / raw)
  To: openembedded-devel

* there is llvm-config in binconfig/LLVM_RELEASE
* this one was creating conflict between different llvm*-dev versions
  installed on target:
  ./llvm2.9/2.9-r3/packages-split/llvm2.9-dev/usr/bin/llvm2.9/llvm-config
  ./llvm2.9/2.9-r3/packages-split/llvm2.9-dev/usr/bin/llvm-config
  ./llvm2.8/2.8-r3/packages-split/llvm2.8-dev/usr/bin/llvm2.8/llvm-config
  ./llvm2.8/2.8-r3/packages-split/llvm2.8-dev/usr/bin/llvm-config

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta-oe/recipes-core/llvm/llvm2.inc | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/meta-oe/recipes-core/llvm/llvm2.inc b/meta-oe/recipes-core/llvm/llvm2.inc
index b5bad45..5ae993a 100644
--- a/meta-oe/recipes-core/llvm/llvm2.inc
+++ b/meta-oe/recipes-core/llvm/llvm2.inc
@@ -110,11 +110,6 @@ do_install() {
 
     # LLVM does not install this by default.
     install bin/tblgen ${D}${bindir}/${LLVM_DIR}
-
-    # we install it here unmodified for native and none native and overwrite it
-    # later for native case
-    install -d ${D}${bindir}
-    install -m 0755 bin/llvm-config ${D}${bindir}
 }
 
 SYSROOT_PREPROCESS_FUNCS_append_class-target = " llvm_sysroot_preprocess"
-- 
1.8.2.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [meta-oe][PATCH 3/4] llvm: use newer class-native overrides instead of virtclass
  2013-07-06 19:33 [meta-oe][PATCH 0/4] llvm cleanup Martin Jansa
  2013-07-06 19:33 ` [meta-oe][PATCH 1/4] llvm: Consolidate .inc files Martin Jansa
  2013-07-06 19:33 ` [meta-oe][PATCH 2/4] llvm2: don't install llvm-config to bindir Martin Jansa
@ 2013-07-06 19:33 ` Martin Jansa
  2013-07-06 19:33 ` [meta-oe][PATCH 4/4] llvm: split packages a bit more Martin Jansa
  3 siblings, 0 replies; 5+ messages in thread
From: Martin Jansa @ 2013-07-06 19:33 UTC (permalink / raw)
  To: openembedded-devel

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta-oe/recipes-core/llvm/llvm-common.bb |  2 +-
 meta-oe/recipes-core/llvm/llvm2.inc      | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/meta-oe/recipes-core/llvm/llvm-common.bb b/meta-oe/recipes-core/llvm/llvm-common.bb
index 192919e..395ab01 100644
--- a/meta-oe/recipes-core/llvm/llvm-common.bb
+++ b/meta-oe/recipes-core/llvm/llvm-common.bb
@@ -14,7 +14,7 @@ llvm_common_sysroot_preprocess() {
     install -m 0755 ${WORKDIR}/llvm-config ${SYSROOT_DESTDIR}${bindir_crossscripts}/
 }
 
-do_install_virtclass-native() {
+do_install_class-native() {
     install -d ${D}${bindir}
     install -m 0755 ${WORKDIR}/llvm-config ${D}${bindir}
 }
diff --git a/meta-oe/recipes-core/llvm/llvm2.inc b/meta-oe/recipes-core/llvm/llvm2.inc
index 5ae993a..b239d30 100644
--- a/meta-oe/recipes-core/llvm/llvm2.inc
+++ b/meta-oe/recipes-core/llvm/llvm2.inc
@@ -1,5 +1,5 @@
 DEPENDS = "llvm${LLVM_RELEASE}-native llvm-common"
-DEPENDS_virtclass-native = "llvm-common-native cmake-native"
+DEPENDS_class-native = "llvm-common-native cmake-native"
 
 SRC_URI = "http://llvm.org/releases/${PV}/llvm-${PV}.tgz"
 S = "${WORKDIR}/llvm-${PV}"
@@ -57,7 +57,7 @@ PACKAGES_DYNAMIC = "llvm-*"
 
 # the difference to the non-native build is that we do not need
 # to declare the location of the tblgen executable.
-EXTRA_OECMAKE_virtclass-native = "\
+EXTRA_OECMAKE_class-native = "\
     -DLLVM_TARGETS_TO_BUILD=${LLVM_ARCH} \
     -DCMAKE_LINKER:FILEPATH=${LD} \
     -DCMAKE_AR:FILEPATH=${AR} \
@@ -68,9 +68,9 @@ EXTRA_OECMAKE_virtclass-native = "\
     -DNM_PATH:FILEPATH=${NM} \
 "
 
-PACKAGES_virtclass-native = ""
+PACKAGES_class-native = ""
 
-PACKAGES_DYNAMIC_virtclass-native = ""
+PACKAGES_DYNAMIC_class-native = ""
 
 python populate_packages_prepend () {
     libllvm_libdir = bb.data.expand('${libdir}/${LLVM_DIR}', d)
@@ -130,7 +130,7 @@ llvm_sysroot_preprocess() {
         install -m 0755 bin/llvm-config${LLVM_RELEASE} ${SYSROOT_DESTDIR}${bindir_crossscripts}
 }
 
-do_install_virtclass-native() {
+do_install_class-native() {
     # Install into a private directory to be able to reorganize the files.
     cd ${LLVM_BUILD_DIR}
     oe_runmake DESTDIR=${LLVM_INSTALL_DIR} install
-- 
1.8.2.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [meta-oe][PATCH 4/4] llvm: split packages a bit more
  2013-07-06 19:33 [meta-oe][PATCH 0/4] llvm cleanup Martin Jansa
                   ` (2 preceding siblings ...)
  2013-07-06 19:33 ` [meta-oe][PATCH 3/4] llvm: use newer class-native overrides instead of virtclass Martin Jansa
@ 2013-07-06 19:33 ` Martin Jansa
  3 siblings, 0 replies; 5+ messages in thread
From: Martin Jansa @ 2013-07-06 19:33 UTC (permalink / raw)
  To: openembedded-devel

* use split for llvm3.* like we did for llvm2.*
* use PACKAGESPLITFUNCS instead of populate_packages_prepend
* improve regexp in PACKAGES_DYNAMIC
* append ${LLVM_RELEASE} to split package name, otherwise sstate
  will complain about multiple recipes trying to install pkgdata
* split also -staticdev and -dbg libs, PN-dbg and PN-staticdev
  were huge, let old PN-dbg/PN-staticdev to RDEPEND on splitted
  packages
* mesa packages libegl-gallium, libgbm-gallium, mesa-driver-pipe-swrast,
  mesa-driver-pipe-vmwgfx, mesa-driver-swrast, mesa-driver-vmwgfx are
  now depending only on libllvm3.2-llvm-3.2 (>= 3.2) instead of main
  llvm3.2 package, but for llvm-3* it's not big improvement
  (installed size wise), because libLLVM-3.2.so was creating 99% of that
  size.
* there are still some huge packages:
  llvm2.8-dbg is huge because BUILD_SHARED_LIBS is disabled for 2.8
              causing all binaries in ${bindir}/.debug to contain big
              static libs
  llvm2.9 is missing, because it has BUILD_SHARED_LIBS enabled and
          unlike 3.* it doesn't build static versions at all unless
          explicitly requested

  51M     llvm-test/llvm3.2/3.2-r0/packages-split/libllvm3.2-llvmselectiondag-staticdev
  53M     llvm-test/llvm2.8/2.8-r3/packages-split/llvm2.8-dev
  54M     llvm-test/llvm2.8/2.8-r3/packages-split/libllvm2.8-llvmanalysis-staticdev
  55M     llvm-test/llvm3.3/3.3-r0/packages-split/libllvm3.3-llvmselectiondag-staticdev
  62M     llvm-test/llvm3.2/3.2-r0/packages-split/libllvm3.2-llvmanalysis-staticdev
  63M     llvm-test/llvm3.3/3.3-r0/packages-split/libllvm3.3-llvmanalysis-staticdev
  67M     llvm-test/llvm2.9/2.9-r3/packages-split/llvm2.9-dbg
  90M     llvm-test/llvm3.2/3.2-r0/packages-split/llvm3.2-dbg
  92M     llvm-test/llvm3.3/3.3-r0/packages-split/llvm3.3-dbg
  102M    llvm-test/llvm2.8/2.8-r3/packages-split/libllvm2.8-llvmcodegen-staticdev
  127M    llvm-test/llvm3.2/3.2-r0/packages-split/libllvm3.2-llvmcodegen-staticdev
  133M    llvm-test/llvm3.3/3.3-r0/packages-split/libllvm3.3-llvmcodegen-staticdev
  190M    llvm-test/llvm3.2/3.2-r0/packages-split/libllvm3.2-llvm-3.2-dbg
  207M    llvm-test/llvm3.3/3.3-r0/packages-split/libllvm3.3-llvm-3.3-dbg
  628M    llvm-test/llvm2.8/2.8-r3/packages-split/llvm2.8-dbg

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta-oe/recipes-core/llvm/llvm.inc  | 30 ++++++++++++++++++++++++++----
 meta-oe/recipes-core/llvm/llvm2.inc | 14 --------------
 meta-oe/recipes-core/llvm/llvm3.inc |  4 ----
 3 files changed, 26 insertions(+), 22 deletions(-)

diff --git a/meta-oe/recipes-core/llvm/llvm.inc b/meta-oe/recipes-core/llvm/llvm.inc
index 20588f3..c0d6b6e 100644
--- a/meta-oe/recipes-core/llvm/llvm.inc
+++ b/meta-oe/recipes-core/llvm/llvm.inc
@@ -32,11 +32,33 @@ inherit perlnative pythonnative
 LLVM_RELEASE = "${PV}"
 LLVM_DIR = "llvm${LLVM_RELEASE}"
 
-FILES_${PN}-dbg += "${bindir}/${LLVM_DIR}/.debug \
-                    ${libdir}/${LLVM_DIR}/.debug \
+ALLOW_EMPTY_${PN} = "1"
+ALLOW_EMPTY_${PN}-staticdev = "1"
+FILES_${PN} = ""
+FILES_${PN}-staticdev = ""
+DOTDEBUG-dbg = " ${bindir}/${LLVM_DIR}/.debug \
+                 ${libdir}/${LLVM_DIR}/.debug/BugpointPasses.so \
+                 ${libdir}/${LLVM_DIR}/.debug/LLVMHello.so \
+                 /usr/src/debug \
 "
-FILES_${PN}-dev += "${bindir} \
+
+FILES_${PN}-dev += "${bindir}/${LLVM_DIR} \
                     ${libdir}/${LLVM_DIR}/BugpointPasses.so \
                     ${libdir}/${LLVM_DIR}/LLVMHello.so \
 "
-FILES_${PN}-staticdev = "${libdir}/${LLVM_DIR}/*.a"
+
+PACKAGES_DYNAMIC = "^libllvm-.*$"
+
+python llvm_populate_packages() {
+    libllvm_libdir = bb.data.expand('${libdir}/${LLVM_DIR}', d)
+    split_packages = do_split_packages(d, libllvm_libdir, '^lib(.*)\.so$', 'libllvm${LLVM_RELEASE}-%s', 'Split package for %s', allow_dirs=True)
+    split_dbg_packages = do_split_packages(d, libllvm_libdir+'/.debug', '^lib(.*)\.so$', 'libllvm${LLVM_RELEASE}-%s-dbg', 'Split debug package for %s', allow_dirs=True)
+    split_staticdev_packages = do_split_packages(d, libllvm_libdir, '^lib(.*)\.a$', 'libllvm${LLVM_RELEASE}-%s-staticdev', 'Split staticdev package for %s', allow_dirs=True)
+    if split_packages:
+        pn = d.getVar('PN', True)
+        d.appendVar('RDEPENDS_' + pn, ' '+' '.join(split_packages))
+        d.appendVar('RDEPENDS_' + pn + '-dbg', ' '+' '.join(split_dbg_packages))
+        d.appendVar('RDEPENDS_' + pn + '-staticdev', ' '+' '.join(split_staticdev_packages))
+}
+
+PACKAGESPLITFUNCS_prepend = "llvm_populate_packages "
diff --git a/meta-oe/recipes-core/llvm/llvm2.inc b/meta-oe/recipes-core/llvm/llvm2.inc
index b239d30..8765a76 100644
--- a/meta-oe/recipes-core/llvm/llvm2.inc
+++ b/meta-oe/recipes-core/llvm/llvm2.inc
@@ -53,8 +53,6 @@ EXTRA_OECMAKE = "\
 # We need to reset this to avoid breakage as we build out of tree
 TOOLCHAIN_OPTIONS = ""
 
-PACKAGES_DYNAMIC = "llvm-*"
-
 # the difference to the non-native build is that we do not need
 # to declare the location of the tblgen executable.
 EXTRA_OECMAKE_class-native = "\
@@ -68,18 +66,6 @@ EXTRA_OECMAKE_class-native = "\
     -DNM_PATH:FILEPATH=${NM} \
 "
 
-PACKAGES_class-native = ""
-
-PACKAGES_DYNAMIC_class-native = ""
-
-python populate_packages_prepend () {
-    libllvm_libdir = bb.data.expand('${libdir}/${LLVM_DIR}', d)
-    do_split_packages(d, libllvm_libdir, '^lib(.*)\.so$', 'libllvm-%s', 'Split package for %s', allow_dirs=True)
-}
-
-FILES_${PN} = ""
-ALLOW_EMPTY_${PN} = "1"
-
 base_do_compile_prepend() {
     # Avoid *** No rule to make target `native/bin/tblgen', needed by `include/llvm/Intrinsics.gen.tmp'
     oe_runmake tblgen
diff --git a/meta-oe/recipes-core/llvm/llvm3.inc b/meta-oe/recipes-core/llvm/llvm3.inc
index b04fe24..798d4a2 100644
--- a/meta-oe/recipes-core/llvm/llvm3.inc
+++ b/meta-oe/recipes-core/llvm/llvm3.inc
@@ -18,10 +18,6 @@ EXTRA_OECONF += "--disable-assertions \
                  --enable-shared \
                  --enable-targets=host-only"
 EXTRA_OEMAKE += "REQUIRES_RTTI=1 VERBOSE=1"
-FILES_${PN} = "${libdir}/lib*.so \
-               ${libdir}/${LLVM_DIR}/*"
-FILES_SOLIBSDEV = ""
-INSANE_SKIP_${PN} = "dev-so"
 
 do_configure_prepend() {
     # Remove RPATHs
-- 
1.8.2.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-07-06 19:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-06 19:33 [meta-oe][PATCH 0/4] llvm cleanup Martin Jansa
2013-07-06 19:33 ` [meta-oe][PATCH 1/4] llvm: Consolidate .inc files Martin Jansa
2013-07-06 19:33 ` [meta-oe][PATCH 2/4] llvm2: don't install llvm-config to bindir Martin Jansa
2013-07-06 19:33 ` [meta-oe][PATCH 3/4] llvm: use newer class-native overrides instead of virtclass Martin Jansa
2013-07-06 19:33 ` [meta-oe][PATCH 4/4] llvm: split packages a bit more Martin Jansa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.