From e602f0edfa99bdc619f9c700b44a26d5b5c67aba Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Fri, 16 Jan 2009 22:48:51 -0500 Subject: canadian sdk: Add classes/canadian{,-cross,-native,-sdk}.bbclass --- classes/canadian-cross.bbclass | 76 +++++++++++++++++++++++++++++++ classes/canadian-native.bbclass | 88 ++++++++++++++++++++++++++++++++++++ classes/canadian-sdk.bbclass | 99 +++++++++++++++++++++++++++++++++++++++++ classes/canadian.bbclass | 24 ++++++++++ 4 files changed, 287 insertions(+) create mode 100644 classes/canadian-cross.bbclass create mode 100644 classes/canadian-native.bbclass create mode 100644 classes/canadian-sdk.bbclass create mode 100644 classes/canadian.bbclass 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}" -- cgit v1.2.3