diff options
Diffstat (limited to 'classes')
-rw-r--r-- | classes/canadian-cross.bbclass | 76 | ||||
-rw-r--r-- | classes/canadian-native.bbclass | 88 | ||||
-rw-r--r-- | classes/canadian-sdk.bbclass | 99 | ||||
-rw-r--r-- | classes/canadian.bbclass | 24 | ||||
-rw-r--r-- | classes/kernel.bbclass | 8 | ||||
-rw-r--r-- | classes/package_ipk.bbclass | 10 | ||||
-rw-r--r-- | classes/sdk.bbclass | 2 |
7 files changed, 302 insertions, 5 deletions
diff --git a/classes/canadian-cross.bbclass b/classes/canadian-cross.bbclass new file mode 100644 index 0000000000..474fb1d2ba --- /dev/null +++ b/classes/canadian-cross.bbclass @@ -0,0 +1,76 @@ +# Canadian cross packages are built indirectly via dependency, +# no need for them to be a direct target of 'world' +EXCLUDE_FROM_WORLD = "1" + +inherit canadian + +PACKAGES = "" + +BASE_PACKAGE_ARCH = "${SDK_ARCH}" +BASEPKG_HOST_SYS = "${SDK_ARCH}${SDK_VENDOR}-${SDK_OS}" +BASEPKG_TARGET_SYS = "${SDK_ARCH}${SDK_VENDOR}-${SDK_OS}" + +HOST_ARCH = "${BUILD_ARCH}" +HOST_VENDOR = "${BUILD_VENDOR}" +HOST_OS = "${BUILD_OS}" +HOST_PREFIX = "${BUILD_PREFIX}" +HOST_CC_ARCH = "${BUILD_CC_ARCH}" +HOST_EXEEXT = "${BUILD_EXEEXT}" + +TARGET_ARCH = "${SDK_ARCH}" +TARGET_VENDOR = "${SDK_VENDOR}" +TARGET_OS = "${SDK_OS}" +TARGET_PREFIX = "${SDK_PREFIX}" +TARGET_CC_ARCH = "${SDK_CC_ARCH}" +TARGET_EXEEXT = "${SDK_EXEEXT}" + +CPPFLAGS = "${BUILD_CPPFLAGS}" +CFLAGS = "${BUILD_CFLAGS}" +CXXFLAGS = "${BUILD_CFLAGS}" +LDFLAGS = "${BUILD_LDFLAGS}" + +TOOLCHAIN_OPTIONS = "" + +# Architecture dependent paths +bindir = "${exec_prefix}/bin" +sbindir = "${exec_prefix}/bin" +libexecdir = "${exec_prefix}/libexec" +libdir = "${exec_prefix}/lib" +includedir = "${exec_prefix}/include" +oldincludedir = "${exec_prefix}/include" + +# Path prefixes +export base_prefix = "${STAGING_DIR_HOST}" +export prefix = "${STAGING_DIR_HOST}${layout_prefix}" +export exec_prefix = "${STAGING_DIR_HOST}${layout_exec_prefix}" + +# Base paths +export base_bindir = "${STAGING_DIR_HOST}${layout_base_bindir}" +export base_sbindir = "${STAGING_DIR_HOST}${layout_base_sbindir}" +export base_libdir = "${STAGING_DIR_HOST}${layout_base_libdir}" + +# Architecture independent paths +export datadir = "${STAGING_DIR_HOST}${layout_datadir}" +export sysconfdir = "${STAGING_DIR_HOST}${layout_sysconfdir}" +export sharedstatedir = "${STAGING_DIR_HOST}${layout_sharedstatedir}" +export localstatedir = "${STAGING_DIR_HOST}${layout_localstatedir}" +export infodir = "${STAGING_DIR_HOST}${layout_infodir}" +export mandir = "${STAGING_DIR_HOST}${layout_mandir}" +export docdir = "${STAGING_DIR_HOST}${layout_docdir}" +export servicedir = "${STAGING_DIR_HOST}${layout_servicedir}" + +# Architecture dependent paths +export bindir = "${STAGING_DIR_HOST}${layout_bindir}" +export sbindir = "${STAGING_DIR_HOST}${layout_sbindir}" +export libexecdir = "${STAGING_DIR_HOST}${layout_libexecdir}" +export libdir = "${STAGING_DIR_HOST}${layout_libdir}" +export includedir = "${STAGING_DIR_HOST}${layout_includedir}" +export oldincludedir = "${STAGING_DIR_HOST}${layout_includedir}" + +do_stage () { + oe_runmake install +} + +do_install () { + : +} diff --git a/classes/canadian-native.bbclass b/classes/canadian-native.bbclass new file mode 100644 index 0000000000..d572ab5990 --- /dev/null +++ b/classes/canadian-native.bbclass @@ -0,0 +1,88 @@ +inherit base + +# Canadian native packages are built indirectly via dependency, +# no need for them to be a direct target of 'world' +EXCLUDE_FROM_WORLD = "1" + +inherit canadian + +PACKAGES = "" + +BASE_PACKAGE_ARCH = "${SDK_ARCH}" +BASEPKG_HOST_SYS = "${SDK_ARCH}${SDK_VENDOR}-${SDK_OS}" +BASEPKG_TARGET_SYS = "${SDK_ARCH}${SDK_VENDOR}-${SDK_OS}" + +HOST_ARCH = "${SDK_ARCH}" +HOST_VENDOR = "${SDK_VENDOR}" +HOST_OS = "${SDK_OS}" +HOST_PREFIX = "${SDK_PREFIX}" +HOST_CC_ARCH = "${SDK_CC_ARCH}" +HOST_EXEEXT = "${SDK_EXEEXT}" + +TARGET_ARCH = "${SDK_ARCH}" +TARGET_VENDOR = "${SDK_VENDOR}" +TARGET_OS = "${SDK_OS}" +TARGET_PREFIX = "${SDK_PREFIX}" +TARGET_CC_ARCH = "${SDK_CC_ARCH}" +TARGET_EXEEXT = "${SDK_EXEEXT}" + +CPPFLAGS = "${SDK_CPPFLAGS}" +CFLAGS = "${SDK_CFLAGS}" +CXXFLAGS = "${SDK_CFLAGS}" +LDFLAGS = "${SDK_LDFLAGS}" + +# set the compiler as well. It could have been set to something else +export CC = "${CCACHE}${SDK_PREFIX}gcc ${HOST_CC_ARCH}" +export CXX = "${CCACHE}${SDK_PREFIX}g++ ${HOST_CC_ARCH}" +export F77 = "${CCACHE}${SDK_PREFIX}g77 ${HOST_CC_ARCH}" +export CPP = "${SDK_PREFIX}gcc -E" +export LD = "${SDK_PREFIX}ld" +#export CCLD = "${CC}" +export AR = "${SDK_PREFIX}ar" +export AS = "${SDK_PREFIX}as" +export RANLIB = "${SDK_PREFIX}ranlib" +export STRIP = "${SDK_PREFIX}strip" + +# Path prefixes +export base_prefix = "${STAGING_DIR_HOST}" +export prefix = "${STAGING_DIR_HOST}${layout_prefix}" +export exec_prefix = "${STAGING_DIR_HOST}${layout_exec_prefix}" + +# Base paths +export base_bindir = "${STAGING_DIR_HOST}${layout_base_bindir}" +export base_sbindir = "${STAGING_DIR_HOST}${layout_base_sbindir}" +export base_libdir = "${STAGING_DIR_HOST}${layout_base_libdir}" + +# Architecture independent paths +export datadir = "${STAGING_DIR_HOST}${layout_datadir}" +export sysconfdir = "${STAGING_DIR_HOST}${layout_sysconfdir}" +export sharedstatedir = "${STAGING_DIR_HOST}${layout_sharedstatedir}" +export localstatedir = "${STAGING_DIR_HOST}${layout_localstatedir}" +export infodir = "${STAGING_DIR_HOST}${layout_infodir}" +export mandir = "${STAGING_DIR_HOST}${layout_mandir}" +export docdir = "${STAGING_DIR_HOST}${layout_docdir}" +export servicedir = "${STAGING_DIR_HOST}${layout_servicedir}" + +# Architecture dependent paths +export bindir = "${STAGING_DIR_HOST}${layout_bindir}" +export sbindir = "${STAGING_DIR_HOST}${layout_sbindir}" +export libexecdir = "${STAGING_DIR_HOST}${layout_libexecdir}" +export libdir = "${STAGING_DIR_HOST}${layout_libdir}" +export includedir = "${STAGING_DIR_HOST}${layout_includedir}" +export oldincludedir = "${STAGING_DIR_HOST}${layout_includedir}" + +do_stage () { + if [ "${INHIBIT_NATIVE_STAGE_INSTALL}" != "1" ] + then + if [ "${AUTOTOOLS_NATIVE_STAGE_INSTALL}" != "1" ] + then + oe_runmake install + else + autotools_stage_all + fi + fi +} + +do_install () { + : +} diff --git a/classes/canadian-sdk.bbclass b/classes/canadian-sdk.bbclass new file mode 100644 index 0000000000..d73b62f485 --- /dev/null +++ b/classes/canadian-sdk.bbclass @@ -0,0 +1,99 @@ +# Canadian SDK packages are built either explicitly by the user, +# or indirectly via dependency. No need to be in 'world'. +EXCLUDE_FROM_WORLD = "1" + +inherit canadian + +PACKAGE_ARCH = "${SDK_SYS}-sdk-${OLD_PACKAGE_ARCH}" +BASE_PACKAGE_ARCH = "${OLD_BASE_PACKAGE_ARCH}" + +HOST_ARCH = "${SDK_ARCH}" +HOST_VENDOR = "${SDK_VENDOR}" +HOST_OS = "${SDK_OS}" +HOST_PREFIX = "${SDK_PREFIX}" +HOST_CC_ARCH = "${SDK_CC_ARCH}" +HOST_EXEEXT = "${SDK_EXEEXT}" + +CPPFLAGS = "${SDK_CPPFLAGS}" +CFLAGS = "${SDK_CFLAGS}" +CXXFLAGS = "${SDK_CFLAGS}" +LDFLAGS = "${SDK_LDFLAGS}" + +# TODO: add logic to add the following unless PN ~= gcc* +#DEPENDS_prepend = "virtual/${HOST_PREFIX}binutils virtual/${HOST_PREFIX}gcc " +# and otherwise just +DEPENDS_prepend = "virtual/${HOST_PREFIX}binutils " + +SDK_PATH_sdk-mingw32 = "/OpenEmbedded/${SDK_NAME}" +SDK_REALPATH = "${SDK_PATH}" +SDK_REALPATH_sdk-mingw32 = "C:/OpenEmbedded/${SDK_NAME}" + +# Path prefixes +prefix = "${SDK_PATH}" +exec_prefix = "${prefix}" +base_prefix = "${prefix}" + +# Base paths +export base_bindir = "${prefix}/bin" +export base_sbindir = "${prefix}/bin" +export base_libdir = "${prefix}/lib" + +# Architecture independent paths +export datadir = "${prefix}/share" +export sysconfdir = "${prefix}/etc" +export sharedstatedir = "${datadir}/com" +export localstatedir = "${prefix}/var" +export infodir = "${datadir}/info" +export mandir = "${datadir}/man" +export docdir = "${datadir}/doc" +export servicedir = "${prefix}/srv" + +# Architecture dependent paths +export bindir = "${prefix}/bin" +export sbindir = "${prefix}/bin" +export libexecdir = "${prefix}/libexec" +export libdir = "${prefix}/lib" +export includedir = "${prefix}/include" +export oldincludedir = "${prefix}/include" + +export dollar = "$" + +canadian_sdk_runconf() { + # modified oe_runconf() + # 1. Override prefix with SDK_REALPATH + # 2. Pass '${prefix}' to configure, to allow for prefix override + # 3. But don't do that for infodir and mandir, as they will + # break gcc makefiles for windows/dos SDK_REALPATH + if [ -x ${S}/configure ] ; then + cfgcmd="${S}/configure \ + --build=${BUILD_SYS} \ + --host=${HOST_SYS} \ + --target=${TARGET_SYS} \ + --prefix=${SDK_REALPATH} \ + --exec-prefix=$dollar{prefix} \ + --bindir=$dollar{prefix}/bin \ + --sbindir=$dollar{prefix}/bin \ + --libexecdir=$dollar{prefix}/libexec \ + --datadir=$dollar{prefix}/share \ + --sysconfdir=$dollar{prefix}/etc \ + --sharedstatedir=$dollar{prefix}/com \ + --localstatedir=$dollar{prefix}/var \ + --libdir=$dollar{prefix}/lib \ + --includedir=$dollar{prefix}/include \ + --oldincludedir=$dollar{prefix}/include \ + --infodir=${prefix}/share/info \ + --mandir=${prefix}/share/man \ + --enable-mainainer-mode \ + ${EXTRA_OECONF} \ + $@" + oenote "Running $cfgcmd..." + $cfgcmd || oefatal "oe_runconf failed" + else + oefatal "no configure script found" + fi +} + +FILES_${PN} = "${prefix}" +FILES_${PN}-dbg += "${prefix}/.debug \ + ${prefix}/bin/.debug \ + " diff --git a/classes/canadian.bbclass b/classes/canadian.bbclass new file mode 100644 index 0000000000..f359a8df7f --- /dev/null +++ b/classes/canadian.bbclass @@ -0,0 +1,24 @@ +# For Canadian SDKs we need to know what these values start out as, and use +# them as well as the updated ones. +OLD_PACKAGE_ARCH := "${PACKAGE_ARCH}" +OLD_MULTIMACH_ARCH := "${MULTIMACH_ARCH}" +OLD_TARGET_VENDOR := "${TARGET_VENDOR}" +OLD_TARGET_OS := "${TARGET_OS}" +OLD_BASE_PACKAGE_ARCH := "${BASE_PACKAGE_ARCH}" + +OLD_MULTIMACH_TARGET_SYS = "${OLD_MULTIMACH_ARCH}${OLD_TARGET_VENDOR}-${OLD_TARGET_OS}" +OLD_BASEPKG_TARGET_SYS = "${OLD_BASE_PACKAGE_ARCH}${OLD_TARGET_VENDOR}-${OLD_TARGET_OS}" + +# We want to allow for both machine-target_os-sdk_arch-sdk_os and for +# sdk_arch-sdk_os +MULTIMACH_SDK_SYS = "${OLD_MULTIMACH_TARGET_SYS}-${SDK_SYS}" +BASEPKG_SDK_SYS = "${OLD_BASEPKG_TARGET_SYS}-${SDK_SYS}" +STAGING_DIR_SDK = "${STAGING_DIR}/${MULTIMACH_SDK_SYS}" + +# Our host dir isn't the build system here, but the SDK system +STAGING_DIR_HOST = "${STAGING_DIR}/${SDK_SYS}" + +# Overrides for paths +STAGING_BINDIR_CROSS = "${STAGING_BINDIR}" + +PACKAGE_ARCH = "${SDK_ARCH}" diff --git a/classes/kernel.bbclass b/classes/kernel.bbclass index d1f59e5e84..86f00da5cf 100644 --- a/classes/kernel.bbclass +++ b/classes/kernel.bbclass @@ -74,9 +74,6 @@ UBOOT_ENTRYPOINT ?= "20008000" UBOOT_LOADADDRESS ?= "${UBOOT_ENTRYPOINT}" kernel_do_compile() { - if [ ! -z "${INITRAMFS_IMAGE}" ]; then - cp "${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.cpio.gz" initramfs.cpio.gz - fi unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE oe_runmake include/linux/version.h CC="${KERNEL_CC}" LD="${KERNEL_LD}" if [ "${KERNEL_MAJOR_VERSION}" != "2.6" ]; then @@ -188,7 +185,10 @@ kernel_do_install() { } kernel_do_configure() { - yes '' | oe_runmake oldconfig + yes '' | oe_runmake oldconfig + if [ ! -z "${INITRAMFS_IMAGE}" ]; then + cp "${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.cpio.gz" initramfs.cpio.gz + fi } do_menuconfig() { diff --git a/classes/package_ipk.bbclass b/classes/package_ipk.bbclass index a20b6bbef6..3a977291ff 100644 --- a/classes/package_ipk.bbclass +++ b/classes/package_ipk.bbclass @@ -5,6 +5,7 @@ IMAGE_PKGTYPE ?= "ipk" IPKGCONF_TARGET = "${STAGING_ETCDIR_NATIVE}/opkg.conf" IPKGCONF_SDK = "${STAGING_ETCDIR_NATIVE}/opkg-sdk.conf" +IPKGCONF_CANSDK = "${STAGING_ETCDIR_NATIVE}/opkg-canadian-sdk.conf" python package_ipk_fn () { from bb import data @@ -90,6 +91,10 @@ package_update_index_ipk () { touch ${DEPLOY_DIR_IPK}/${BUILD_ARCH}-$arch-sdk/Packages ipkg-make-index -r ${DEPLOY_DIR_IPK}/${BUILD_ARCH}-$arch-sdk/Packages -p ${DEPLOY_DIR_IPK}/${BUILD_ARCH}-$arch-sdk/Packages -l ${DEPLOY_DIR_IPK}/${BUILD_ARCH}-$arch-sdk/Packages.filelist -m ${DEPLOY_DIR_IPK}/${BUILD_ARCH}-$arch-sdk/ fi + if [ -e ${DEPLOY_DIR_IPK}/${SDK_SYS}-sdk-$arch/ ] ; then + touch ${DEPLOY_DIR_IPK}/${SDK_SYS}-sdk-$arch/Packages + ipkg-make-index -r ${DEPLOY_DIR_IPK}/${SDK_SYS}-sdk-$arch/Packages -p ${DEPLOY_DIR_IPK}/${SDK_SYS}-sdk-$arch/Packages -l ${DEPLOY_DIR_IPK}/${SDK_SYS}-sdk-$arch/Packages.filelist -m ${DEPLOY_DIR_IPK}/${SDK_SYS}-sdk-$arch/ + fi done } @@ -102,11 +107,13 @@ package_generate_ipkg_conf () { mkdir -p ${STAGING_ETCDIR_NATIVE}/ echo "src oe file:${DEPLOY_DIR_IPK}" > ${IPKGCONF_TARGET} echo "src oe file:${DEPLOY_DIR_IPK}" > ${IPKGCONF_SDK} + echo "src oe file:${DEPLOY_DIR_IPK}" > ${IPKGCONF_CANSDK} ipkgarchs="${PACKAGE_ARCHS}" priority=1 for arch in $ipkgarchs; do echo "arch $arch $priority" >> ${IPKGCONF_TARGET} echo "arch ${BUILD_ARCH}-$arch-sdk $priority" >> ${IPKGCONF_SDK} + echo "arch ${SDK_SYS}-sdk-$arch $priority" >> ${IPKGCONF_CANSDK} priority=$(expr $priority + 5) if [ -e ${DEPLOY_DIR_IPK}/$arch/Packages ] ; then echo "src oe-$arch file:${DEPLOY_DIR_IPK}/$arch" >> ${IPKGCONF_TARGET} @@ -114,6 +121,9 @@ package_generate_ipkg_conf () { if [ -e ${DEPLOY_DIR_IPK}/${BUILD_ARCH}-$arch-sdk/Packages ] ; then echo "src oe-${BUILD_ARCH}-$arch-sdk file:${DEPLOY_DIR_IPK}/${BUILD_ARCH}-$arch-sdk" >> ${IPKGCONF_SDK} fi + if [ -e ${DEPLOY_DIR_IPK}/${SDK_SYS}-sdk-$arch/Packages ] ; then + echo "src oe-${SDK_SYS}-sdk-$arch file:${DEPLOY_DIR_IPK}/${SDK_SYS}-sdk-$arch" >> ${IPKGCONF_CANSDK} + fi done } diff --git a/classes/sdk.bbclass b/classes/sdk.bbclass index da6cab9cd5..eb34bd04b5 100644 --- a/classes/sdk.bbclass +++ b/classes/sdk.bbclass @@ -28,7 +28,7 @@ CXXFLAGS = "${BUILD_CFLAGS}" LDFLAGS = "${BUILD_LDFLAGS}" # Path prefixes -prefix = "${SDK_PREFIX}" +prefix = "${SDK_PATH}" exec_prefix = "${prefix}" base_prefix = "${prefix}" |