binconfig.bbclass: install foo-config as foo-config-native for native packages,
authorMichael Lauer <mickey@vanille-media.de>
Mon, 8 Aug 2005 12:10:08 +0000 (12:10 +0000)
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>
Mon, 8 Aug 2005 12:10:08 +0000 (12:10 +0000)
this way the config packages don't step over each other's toes

classes/binconfig.bbclass

index c660fd9..35f859b 100644 (file)
@@ -19,11 +19,25 @@ def get_binconfig_mangle(d):
                s += " -e 's:OEEXECPREFIX:${STAGING_LIBDIR}/..:'"
        return s
 
+# Native package configurations go in ${BINDIR}/<name>-config-native to prevent a collision with cross packages
+def is_native_pkg(d):
+       import bb.data, os
+       if not bb.data.inherits_class('native', d):
+               return "no"
+       else:
+               return "yes"
+
 do_stage_append() {
        for config in `find ${S} -name '*-config'`; do
-               configname=`basename $config`
-               install -d ${STAGING_BINDIR}/${HOST_SYS}
-               cat $config | sed ${@get_binconfig_mangle(d)} > ${STAGING_BINDIR}/${HOST_SYS}/$configname
-               chmod u+x ${STAGING_BINDIR}/${HOST_SYS}/$configname
+               origname=`basename $config`
+               if [ "${@is_native_pkg(d)}" == "yes" ]
+               then
+                       configname=$origname-native
+               else
+                       configname=$origname
+               fi
+               install -d ${STAGING_BINDIR}
+               cat $config | sed ${@get_binconfig_mangle(d)} > ${STAGING_BINDIR}/$configname
+               chmod u+x ${STAGING_BINDIR}/$configname
        done
 }