diff options
| author | Koen Kooi <koen@dominion.thruhere.net> | 2011-03-17 21:41:22 +0100 |
|---|---|---|
| committer | Koen Kooi <koen@dominion.thruhere.net> | 2011-03-17 21:41:22 +0100 |
| commit | c58cc7d3796dcee6e93885c835ed04cb566abeb2 (patch) | |
| tree | 3eea4d4ef6a4ef79e0f4e025d7012c1a5cc38835 /meta-oe/classes | |
| parent | eec6ab97f712e06eb52c9f7c99e19ffab3ce9d74 (diff) | |
| download | meta-openembedded-c58cc7d3796dcee6e93885c835ed04cb566abeb2.tar.gz | |
move layer into meta-oe in preparation for future splits
As per TSC decision
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'meta-oe/classes')
| -rw-r--r-- | meta-oe/classes/gnome.bbclass | 4 | ||||
| -rw-r--r-- | meta-oe/classes/gnomebase.bbclass | 30 | ||||
| -rw-r--r-- | meta-oe/classes/kernel.bbclass | 560 | ||||
| -rw-r--r-- | meta-oe/classes/mime.bbclass | 56 | ||||
| -rw-r--r-- | meta-oe/classes/qmake_base.bbclass | 91 | ||||
| -rw-r--r-- | meta-oe/classes/qt4e.bbclass | 17 | ||||
| -rw-r--r-- | meta-oe/classes/siteinfo.bbclass | 218 |
7 files changed, 976 insertions, 0 deletions
diff --git a/meta-oe/classes/gnome.bbclass b/meta-oe/classes/gnome.bbclass new file mode 100644 index 0000000000..0a32a7796d --- /dev/null +++ b/meta-oe/classes/gnome.bbclass | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | inherit gnomebase gtk-icon-cache gconf mime | ||
| 2 | |||
| 3 | EXTRA_OECONF += "--enable-introspection=no" | ||
| 4 | BBCLASSEXTEND += "native" | ||
diff --git a/meta-oe/classes/gnomebase.bbclass b/meta-oe/classes/gnomebase.bbclass new file mode 100644 index 0000000000..b50504f983 --- /dev/null +++ b/meta-oe/classes/gnomebase.bbclass | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | def gnome_verdir(v): | ||
| 2 | import re | ||
| 3 | m = re.match("^([0-9]+)\.([0-9]+)", v) | ||
| 4 | return "%s.%s" % (m.group(1), m.group(2)) | ||
| 5 | |||
| 6 | SECTION ?= "x11/gnome" | ||
| 7 | SRC_URI = "${GNOME_MIRROR}/${BPN}/${@gnome_verdir("${PV}")}/${BPN}-${PV}.tar.bz2;name=archive" | ||
| 8 | |||
| 9 | DEPENDS += "gnome-common" | ||
| 10 | |||
| 11 | FILES_${PN} += "${datadir}/application-registry \ | ||
| 12 | ${datadir}/mime-info \ | ||
| 13 | ${datadir}/mime/packages \ | ||
| 14 | ${datadir}/mime/application \ | ||
| 15 | ${datadir}/gnome-2.0 \ | ||
| 16 | ${datadir}/polkit* \ | ||
| 17 | " | ||
| 18 | |||
| 19 | FILES_${PN}-doc += "${datadir}/devhelp" | ||
| 20 | |||
| 21 | inherit autotools pkgconfig | ||
| 22 | |||
| 23 | AUTOTOOLS_STAGE_PKGCONFIG = "1" | ||
| 24 | |||
| 25 | do_install_append() { | ||
| 26 | rm -rf ${D}${localstatedir}/lib/scrollkeeper/* | ||
| 27 | rm -rf ${D}${localstatedir}/scrollkeeper/* | ||
| 28 | rm -f ${D}${datadir}/applications/*.cache | ||
| 29 | } | ||
| 30 | |||
diff --git a/meta-oe/classes/kernel.bbclass b/meta-oe/classes/kernel.bbclass new file mode 100644 index 0000000000..13670f6674 --- /dev/null +++ b/meta-oe/classes/kernel.bbclass | |||
| @@ -0,0 +1,560 @@ | |||
| 1 | inherit linux-kernel-base module_strip | ||
| 2 | |||
| 3 | PROVIDES += "virtual/kernel" | ||
| 4 | DEPENDS += "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}depmod-${@get_kernelmajorversion('${PV}')} virtual/${TARGET_PREFIX}gcc${KERNEL_CCSUFFIX} update-modules" | ||
| 5 | |||
| 6 | # we include gcc above, we dont need virtual/libc | ||
| 7 | INHIBIT_DEFAULT_DEPS = "1" | ||
| 8 | |||
| 9 | KERNEL_IMAGETYPE ?= "zImage" | ||
| 10 | |||
| 11 | python __anonymous () { | ||
| 12 | kerneltype = bb.data.getVar('KERNEL_IMAGETYPE', d, 1) or '' | ||
| 13 | if kerneltype == 'uImage': | ||
| 14 | depends = bb.data.getVar("DEPENDS", d, 1) | ||
| 15 | depends = "%s u-boot-mkimage-native" % depends | ||
| 16 | bb.data.setVar("DEPENDS", depends, d) | ||
| 17 | |||
| 18 | image = bb.data.getVar('INITRAMFS_IMAGE', d, True) | ||
| 19 | if image != '' and image is not None: | ||
| 20 | bb.data.setVar('INITRAMFS_TASK', '${INITRAMFS_IMAGE}:do_rootfs', d) | ||
| 21 | |||
| 22 | machine_kernel_pr = bb.data.getVar('MACHINE_KERNEL_PR', d, True) | ||
| 23 | |||
| 24 | if machine_kernel_pr: | ||
| 25 | bb.data.setVar('PR', machine_kernel_pr, d) | ||
| 26 | } | ||
| 27 | |||
| 28 | INITRAMFS_IMAGE ?= "" | ||
| 29 | INITRAMFS_TASK ?= "" | ||
| 30 | |||
| 31 | inherit kernel-arch deploy | ||
| 32 | |||
| 33 | PACKAGES_DYNAMIC += "kernel-module-*" | ||
| 34 | PACKAGES_DYNAMIC += "kernel-image-*" | ||
| 35 | PACKAGES_DYNAMIC += "kernel-firmware-*" | ||
| 36 | |||
| 37 | export OS = "${TARGET_OS}" | ||
| 38 | export CROSS_COMPILE = "${TARGET_PREFIX}" | ||
| 39 | |||
| 40 | KERNEL_PRIORITY = "${@bb.data.getVar('PV',d,1).split('-')[0].split('.')[-1]}" | ||
| 41 | |||
| 42 | KERNEL_RELEASE ?= "${KERNEL_VERSION}" | ||
| 43 | |||
| 44 | KERNEL_CCSUFFIX ?= "" | ||
| 45 | KERNEL_LDSUFFIX ?= "" | ||
| 46 | |||
| 47 | # Set TARGET_??_KERNEL_ARCH in the machine .conf to set architecture | ||
| 48 | # specific options necessary for building the kernel and modules. | ||
| 49 | #FIXME: should be this: TARGET_CC_KERNEL_ARCH ?= "${TARGET_CC_ARCH}" | ||
| 50 | TARGET_CC_KERNEL_ARCH ?= "" | ||
| 51 | HOST_CC_KERNEL_ARCH ?= "${TARGET_CC_KERNEL_ARCH}" | ||
| 52 | TARGET_LD_KERNEL_ARCH ?= "" | ||
| 53 | HOST_LD_KERNEL_ARCH ?= "${TARGET_LD_KERNEL_ARCH}" | ||
| 54 | |||
| 55 | KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc${KERNEL_CCSUFFIX} ${HOST_CC_KERNEL_ARCH}${TOOLCHAIN_OPTIONS}" | ||
| 56 | KERNEL_LD = "${LD}${KERNEL_LDSUFFIX} ${HOST_LD_KERNEL_ARCH}${TOOLCHAIN_OPTIONS}" | ||
| 57 | |||
| 58 | # Where built kernel lies in the kernel tree | ||
| 59 | KERNEL_OUTPUT ?= "arch/${ARCH}/boot/${KERNEL_IMAGETYPE}" | ||
| 60 | KERNEL_IMAGEDEST = "boot" | ||
| 61 | |||
| 62 | # | ||
| 63 | # configuration | ||
| 64 | # | ||
| 65 | export CMDLINE_CONSOLE = "console=${@bb.data.getVar("KERNEL_CONSOLE",d,1) or "ttyS0"}" | ||
| 66 | |||
| 67 | KERNEL_VERSION = "${@get_kernelversion('${B}')}" | ||
| 68 | KERNEL_MAJOR_VERSION = "${@get_kernelmajorversion('${KERNEL_VERSION}')}" | ||
| 69 | |||
| 70 | KERNEL_LOCALVERSION ?= "" | ||
| 71 | |||
| 72 | # kernels are generally machine specific | ||
| 73 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
| 74 | |||
| 75 | # U-Boot support | ||
| 76 | UBOOT_ENTRYPOINT ?= "20008000" | ||
| 77 | UBOOT_LOADADDRESS ?= "${UBOOT_ENTRYPOINT}" | ||
| 78 | |||
| 79 | # For the kernel, we don't want the '-e MAKEFLAGS=' in EXTRA_OEMAKE. | ||
| 80 | # We don't want to override kernel Makefile variables from the environment | ||
| 81 | EXTRA_OEMAKE = "" | ||
| 82 | |||
| 83 | KERNEL_ALT_IMAGETYPE ??= "" | ||
| 84 | |||
| 85 | kernel_do_compile() { | ||
| 86 | unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE | ||
| 87 | oe_runmake include/linux/version.h CC="${KERNEL_CC}" LD="${KERNEL_LD}" | ||
| 88 | if [ "${KERNEL_MAJOR_VERSION}" != "2.6" ]; then | ||
| 89 | oe_runmake dep CC="${KERNEL_CC}" LD="${KERNEL_LD}" | ||
| 90 | fi | ||
| 91 | oe_runmake ${KERNEL_IMAGETYPE} ${KERNEL_ALT_IMAGETYPE} CC="${KERNEL_CC}" LD="${KERNEL_LD}" | ||
| 92 | } | ||
| 93 | |||
| 94 | do_compile_kernelmodules() { | ||
| 95 | unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE | ||
| 96 | if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then | ||
| 97 | oe_runmake modules CC="${KERNEL_CC}" LD="${KERNEL_LD}" | ||
| 98 | else | ||
| 99 | oenote "no modules to compile" | ||
| 100 | fi | ||
| 101 | } | ||
| 102 | addtask compile_kernelmodules after do_compile before do_install | ||
| 103 | |||
| 104 | kernel_do_install() { | ||
| 105 | # | ||
| 106 | # First install the modules | ||
| 107 | # | ||
| 108 | unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE | ||
| 109 | if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then | ||
| 110 | oe_runmake DEPMOD=echo INSTALL_MOD_PATH="${D}" modules_install | ||
| 111 | else | ||
| 112 | oenote "no modules to install" | ||
| 113 | fi | ||
| 114 | |||
| 115 | # | ||
| 116 | # Install various kernel output (zImage, map file, config, module support files) | ||
| 117 | # | ||
| 118 | install -d ${D}/${KERNEL_IMAGEDEST} | ||
| 119 | install -d ${D}/boot | ||
| 120 | install -m 0644 ${KERNEL_OUTPUT} ${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION} | ||
| 121 | install -m 0644 System.map ${D}/boot/System.map-${KERNEL_VERSION} | ||
| 122 | install -m 0644 .config ${D}/boot/config-${KERNEL_VERSION} | ||
| 123 | install -m 0644 vmlinux ${D}/boot/vmlinux-${KERNEL_VERSION} | ||
| 124 | [ -e Module.symvers ] && install -m 0644 Module.symvers ${D}/boot/Module.symvers-${KERNEL_VERSION} | ||
| 125 | install -d ${D}/etc/modutils | ||
| 126 | if [ "${KERNEL_MAJOR_VERSION}" = "2.6" ]; then | ||
| 127 | install -d ${D}/etc/modprobe.d | ||
| 128 | fi | ||
| 129 | |||
| 130 | |||
| 131 | |||
| 132 | # | ||
| 133 | # Support for external module building - create a minimal copy of the kernel source tree | ||
| 134 | # | ||
| 135 | kerneldir=${D}/kernel/ | ||
| 136 | |||
| 137 | # Take care of arch specific headers | ||
| 138 | # Kernel 2.6.27 moved headers from includes/asm-${ARCH} to arch/${ARCH}/include/asm | ||
| 139 | if [ -e arch/${ARCH}/include/asm/ ] ; then | ||
| 140 | install -d $kerneldir/arch/${ARCH}/ | ||
| 141 | cp -fR arch/${ARCH}/* $kerneldir/arch/${ARCH}/ | ||
| 142 | |||
| 143 | # Check for arch/x86 on i386 | ||
| 144 | elif [ -d arch/x86/include/asm/ ]; then | ||
| 145 | if [ -e include/asm ] ; then | ||
| 146 | install -d $kerneldir/include/asm/ | ||
| 147 | cp -fR arch/x86/include/asm/* $kerneldir/include/asm/ | ||
| 148 | fi | ||
| 149 | install -d $kerneldir/arch/x86/include | ||
| 150 | cp -fR arch/x86/* $kerneldir/arch/x86/ | ||
| 151 | fi | ||
| 152 | |||
| 153 | # Take care of the rest of the main directories we need | ||
| 154 | for entry in drivers/crypto drivers/media include scripts; do | ||
| 155 | if [ -d $entry ]; then | ||
| 156 | mkdir -p $kerneldir/$entry | ||
| 157 | cp -fR $entry/* $kerneldir/$entry/ | ||
| 158 | fi | ||
| 159 | done | ||
| 160 | |||
| 161 | install -m 0644 .config $kerneldir/config-${KERNEL_VERSION} | ||
| 162 | ln -sf config-${KERNEL_VERSION} $kerneldir/.config | ||
| 163 | ln -sf config-${KERNEL_VERSION} $kerneldir/kernel-config | ||
| 164 | echo "${KERNEL_VERSION}" >$kerneldir/kernel-abiversion | ||
| 165 | echo "${S}" >$kerneldir/kernel-source | ||
| 166 | echo "${KERNEL_CCSUFFIX}" >$kerneldir/kernel-ccsuffix | ||
| 167 | echo "${KERNEL_LDSUFFIX}" >$kerneldir/kernel-ldsuffix | ||
| 168 | [ -e vmlinux ] && install -m 0644 vmlinux $kerneldir/ | ||
| 169 | install -m 0644 ${KERNEL_OUTPUT} $kerneldir/${KERNEL_IMAGETYPE} | ||
| 170 | install -m 0644 System.map $kerneldir/System.map-${KERNEL_VERSION} | ||
| 171 | [ -e Module.symvers ] && install -m 0644 Module.symvers $kerneldir/ | ||
| 172 | |||
| 173 | # Copy over the main Makefiles | ||
| 174 | [ -e Rules.make ] && install -m 0644 Rules.make $kerneldir/ | ||
| 175 | [ -e Makefile ] && install -m 0644 Makefile $kerneldir/ | ||
| 176 | # Check if arch/${ARCH}/Makefile exists and install it | ||
| 177 | if [ -e arch/${ARCH}/Makefile ]; then | ||
| 178 | install -d $kerneldir/arch/${ARCH} | ||
| 179 | install -m 0644 arch/${ARCH}/Makefile* $kerneldir/arch/${ARCH} | ||
| 180 | # Otherwise check arch/x86/Makefile for i386 and x86_64 on kernels >= 2.6.24 | ||
| 181 | elif [ -e arch/x86/Makefile ]; then | ||
| 182 | install -d $kerneldir/arch/x86 | ||
| 183 | install -m 0644 arch/x86/Makefile* $kerneldir/arch/x86 | ||
| 184 | fi | ||
| 185 | |||
| 186 | # Remove the following binaries which cause strip errors | ||
| 187 | # during do_package for cross-compiled platforms | ||
| 188 | bin_files="arch/powerpc/boot/addnote arch/powerpc/boot/hack-coff \ | ||
| 189 | arch/powerpc/boot/mktree scripts/bin2c scripts/conmakehash \ | ||
| 190 | scripts/ihex2fw scripts/kallsyms scripts/pnmtologo scripts/basic/docproc \ | ||
| 191 | scripts/basic/fixdep scripts/basic/hash scripts/dtc/dtc \ | ||
| 192 | scripts/genksyms/genksyms scripts/kconfig/conf scripts/mod/mk_elfconfig \ | ||
| 193 | scripts/mod/modpost scripts/recordmcount" | ||
| 194 | rm -rf $kerneldir/scripts/*.o | ||
| 195 | rm -rf $kerneldir/scripts/basic/*.o | ||
| 196 | rm -rf $kerneldir/scripts/kconfig/*.o | ||
| 197 | rm -rf $kerneldir/scripts/mod/*.o | ||
| 198 | rm -rf $kerneldir/scripts/dtc/*.o | ||
| 199 | for entry in $bin_files; do | ||
| 200 | rm -f $kerneldir/$entry | ||
| 201 | done | ||
| 202 | } | ||
| 203 | |||
| 204 | sysroot_stage_all_append() { | ||
| 205 | sysroot_stage_dir ${D}/kernel ${SYSROOT_DESTDIR}/kernel | ||
| 206 | } | ||
| 207 | |||
| 208 | |||
| 209 | kernel_do_configure() { | ||
| 210 | # Copy defconfig to .config if .config does not exist. This allows | ||
| 211 | # recipes to manage the .config themselves in do_configure_prepend(). | ||
| 212 | if [ -f "${WORKDIR}/defconfig" ] && [ ! -f "${S}/.config" ]; then | ||
| 213 | cp "${WORKDIR}/defconfig" "${S}/.config" | ||
| 214 | fi | ||
| 215 | |||
| 216 | yes '' | oe_runmake oldconfig | ||
| 217 | |||
| 218 | if [ ! -z "${INITRAMFS_IMAGE}" ]; then | ||
| 219 | for img in cpio.gz cpio.lzo cpio.lzma; do | ||
| 220 | if [ -e "${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.$img" ]; then | ||
| 221 | cp "${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.$img" initramfs.$img | ||
| 222 | fi | ||
| 223 | done | ||
| 224 | fi | ||
| 225 | } | ||
| 226 | |||
| 227 | kernel_do_configure[depends] += "${INITRAMFS_TASK}" | ||
| 228 | |||
| 229 | do_menuconfig() { | ||
| 230 | export DISPLAY='${DISPLAY}' | ||
| 231 | export DBUS_SESSION_BUS_ADDRESS='${DBUS_SESSION_BUS_ADDRESS}' | ||
| 232 | export XAUTHORITY='${XAUTHORITY}' | ||
| 233 | export TERMWINDOWTITLE="${PN} Kernel Configuration" | ||
| 234 | export SHELLCMDS="make menuconfig" | ||
| 235 | ${TERMCMDRUN} | ||
| 236 | if [ $? -ne 0 ]; then | ||
| 237 | echo "Fatal: '${TERMCMD}' not found. Check TERMCMD variable." | ||
| 238 | exit 1 | ||
| 239 | fi | ||
| 240 | } | ||
| 241 | do_menuconfig[nostamp] = "1" | ||
| 242 | addtask menuconfig after do_patch | ||
| 243 | |||
| 244 | pkg_postinst_kernel () { | ||
| 245 | cd /${KERNEL_IMAGEDEST}; update-alternatives --install /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE} ${KERNEL_IMAGETYPE} ${KERNEL_IMAGETYPE}-${KERNEL_VERSION} ${KERNEL_PRIORITY} || true | ||
| 246 | } | ||
| 247 | |||
| 248 | pkg_postrm_kernel () { | ||
| 249 | cd /${KERNEL_IMAGEDEST}; update-alternatives --remove ${KERNEL_IMAGETYPE} ${KERNEL_IMAGETYPE}-${KERNEL_VERSION} || true | ||
| 250 | } | ||
| 251 | |||
| 252 | inherit cml1 | ||
| 253 | |||
| 254 | EXPORT_FUNCTIONS do_compile do_install do_configure | ||
| 255 | |||
| 256 | # kernel-base becomes kernel-${KERNEL_VERSION} | ||
| 257 | # kernel-image becomes kernel-image-${KERNEL_VERISON} | ||
| 258 | PACKAGES = "kernel kernel-base kernel-image kernel-dev kernel-vmlinux kernel-misc" | ||
| 259 | FILES = "" | ||
| 260 | FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*" | ||
| 261 | FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config*" | ||
| 262 | FILES_kernel-vmlinux = "/boot/vmlinux*" | ||
| 263 | # misc is a package to contain files we need in staging | ||
| 264 | FILES_kernel-misc = "/kernel/include/config /kernel/scripts /kernel/drivers/crypto /kernel/drivers/media" | ||
| 265 | RDEPENDS_kernel = "kernel-base" | ||
| 266 | # Allow machines to override this dependency if kernel image files are | ||
| 267 | # not wanted in images as standard | ||
| 268 | RDEPENDS_kernel-base ?= "kernel-image" | ||
| 269 | PKG_kernel-image = "kernel-image-${KERNEL_VERSION}" | ||
| 270 | PKG_kernel-base = "kernel-${KERNEL_VERSION}" | ||
| 271 | ALLOW_EMPTY_kernel = "1" | ||
| 272 | ALLOW_EMPTY_kernel-base = "1" | ||
| 273 | ALLOW_EMPTY_kernel-image = "1" | ||
| 274 | |||
| 275 | # Userspace workarounds for kernel modules issues | ||
| 276 | # This is shame, fix the kernel instead! | ||
| 277 | DEPENDS_kernel-module-dtl1-cs = "bluez-dtl1-workaround" | ||
| 278 | RDEPENDS_kernel-module-dtl1-cs = "bluez-dtl1-workaround" | ||
| 279 | |||
| 280 | pkg_postinst_kernel-image () { | ||
| 281 | if [ ! -e "$D/lib/modules/${KERNEL_VERSION}" ]; then | ||
| 282 | mkdir -p $D/lib/modules/${KERNEL_VERSION} | ||
| 283 | fi | ||
| 284 | if [ -n "$D" ]; then | ||
| 285 | ${HOST_PREFIX}depmod-${KERNEL_MAJOR_VERSION} -A -b $D -F ${STAGING_KERNEL_DIR}/System.map-${KERNEL_VERSION} ${KERNEL_VERSION} | ||
| 286 | else | ||
| 287 | depmod -a | ||
| 288 | fi | ||
| 289 | } | ||
| 290 | |||
| 291 | pkg_postinst_modules () { | ||
| 292 | if [ -n "$D" ]; then | ||
| 293 | ${HOST_PREFIX}depmod-${KERNEL_MAJOR_VERSION} -A -b $D -F ${STAGING_KERNEL_DIR}/System.map-${KERNEL_VERSION} ${KERNEL_VERSION} | ||
| 294 | else | ||
| 295 | depmod -a | ||
| 296 | update-modules || true | ||
| 297 | fi | ||
| 298 | } | ||
| 299 | |||
| 300 | pkg_postrm_modules () { | ||
| 301 | update-modules || true | ||
| 302 | } | ||
| 303 | |||
| 304 | autoload_postinst_fragment() { | ||
| 305 | if [ x"$D" = "x" ]; then | ||
| 306 | modprobe %s || true | ||
| 307 | fi | ||
| 308 | } | ||
| 309 | |||
| 310 | # autoload defaults (alphabetically sorted) | ||
| 311 | module_autoload_hidp = "hidp" | ||
| 312 | module_autoload_ipv6 = "ipv6" | ||
| 313 | module_autoload_ipsec = "ipsec" | ||
| 314 | module_autoload_ircomm-tty = "ircomm-tty" | ||
| 315 | module_autoload_rfcomm = "rfcomm" | ||
| 316 | module_autoload_sa1100-rtc = "sa1100-rtc" | ||
| 317 | # sa1100-rtc was renamed in 2.6.23 onwards | ||
| 318 | module_autoload_rtc-sa1100 = "rtc-sa1100" | ||
| 319 | |||
| 320 | # alias defaults (alphabetically sorted) | ||
| 321 | module_conf_af_packet = "alias net-pf-17 af_packet" | ||
| 322 | module_conf_bluez = "alias net-pf-31 bluez" | ||
| 323 | module_conf_bnep = "alias bt-proto-4 bnep" | ||
| 324 | module_conf_hci_uart = "alias tty-ldisc-15 hci_uart" | ||
| 325 | module_conf_l2cap = "alias bt-proto-0 l2cap" | ||
| 326 | module_conf_sco = "alias bt-proto-2 sco" | ||
| 327 | module_conf_rfcomm = "alias bt-proto-3 rfcomm" | ||
| 328 | |||
| 329 | python populate_packages_prepend () { | ||
| 330 | def extract_modinfo(file): | ||
| 331 | import tempfile, re | ||
| 332 | tempfile.tempdir = bb.data.getVar("WORKDIR", d, 1) | ||
| 333 | tf = tempfile.mkstemp() | ||
| 334 | tmpfile = tf[1] | ||
| 335 | cmd = "PATH=\"%s\" %sobjcopy -j .modinfo -O binary %s %s" % (bb.data.getVar("PATH", d, 1), bb.data.getVar("HOST_PREFIX", d, 1) or "", file, tmpfile) | ||
| 336 | os.system(cmd) | ||
| 337 | f = open(tmpfile) | ||
| 338 | l = f.read().split("\000") | ||
| 339 | f.close() | ||
| 340 | os.close(tf[0]) | ||
| 341 | os.unlink(tmpfile) | ||
| 342 | exp = re.compile("([^=]+)=(.*)") | ||
| 343 | vals = {} | ||
| 344 | for i in l: | ||
| 345 | m = exp.match(i) | ||
| 346 | if not m: | ||
| 347 | continue | ||
| 348 | vals[m.group(1)] = m.group(2) | ||
| 349 | return vals | ||
| 350 | |||
| 351 | def parse_depmod(): | ||
| 352 | import re | ||
| 353 | |||
| 354 | dvar = bb.data.getVar('PKGD', d, 1) | ||
| 355 | if not dvar: | ||
| 356 | bb.error("PKGD not defined") | ||
| 357 | return | ||
| 358 | |||
| 359 | kernelver = bb.data.getVar('KERNEL_VERSION', d, 1) | ||
| 360 | kernelver_stripped = kernelver | ||
| 361 | m = re.match('^(.*-hh.*)[\.\+].*$', kernelver) | ||
| 362 | if m: | ||
| 363 | kernelver_stripped = m.group(1) | ||
| 364 | path = bb.data.getVar("PATH", d, 1) | ||
| 365 | host_prefix = bb.data.getVar("HOST_PREFIX", d, 1) or "" | ||
| 366 | major_version = bb.data.getVar('KERNEL_MAJOR_VERSION', d, 1) | ||
| 367 | |||
| 368 | cmd = "PATH=\"%s\" %sdepmod-%s -n -a -r -b %s -F %s/boot/System.map-%s %s" % (path, host_prefix, major_version, dvar, dvar, kernelver, kernelver_stripped) | ||
| 369 | f = os.popen(cmd, 'r') | ||
| 370 | |||
| 371 | deps = {} | ||
| 372 | pattern0 = "^(.*\.k?o):..*$" | ||
| 373 | pattern1 = "^(.*\.k?o):\s*(.*\.k?o)\s*$" | ||
| 374 | pattern2 = "^(.*\.k?o):\s*(.*\.k?o)\s*\\\$" | ||
| 375 | pattern3 = "^\t(.*\.k?o)\s*\\\$" | ||
| 376 | pattern4 = "^\t(.*\.k?o)\s*$" | ||
| 377 | |||
| 378 | line = f.readline() | ||
| 379 | while line: | ||
| 380 | if not re.match(pattern0, line): | ||
| 381 | line = f.readline() | ||
| 382 | continue | ||
| 383 | m1 = re.match(pattern1, line) | ||
| 384 | if m1: | ||
| 385 | deps[m1.group(1)] = m1.group(2).split() | ||
| 386 | else: | ||
| 387 | m2 = re.match(pattern2, line) | ||
| 388 | if m2: | ||
| 389 | deps[m2.group(1)] = m2.group(2).split() | ||
| 390 | line = f.readline() | ||
| 391 | m3 = re.match(pattern3, line) | ||
| 392 | while m3: | ||
| 393 | deps[m2.group(1)].extend(m3.group(1).split()) | ||
| 394 | line = f.readline() | ||
| 395 | m3 = re.match(pattern3, line) | ||
| 396 | m4 = re.match(pattern4, line) | ||
| 397 | deps[m2.group(1)].extend(m4.group(1).split()) | ||
| 398 | line = f.readline() | ||
| 399 | f.close() | ||
| 400 | return deps | ||
| 401 | |||
| 402 | def get_dependencies(file, pattern, format): | ||
| 403 | # file no longer includes PKGD | ||
| 404 | file = file.replace(bb.data.getVar('PKGD', d, 1) or '', '', 1) | ||
| 405 | # instead is prefixed with /lib/modules/${KERNEL_VERSION} | ||
| 406 | file = file.replace("/lib/modules/%s/" % bb.data.getVar('KERNEL_VERSION', d, 1) or '', '', 1) | ||
| 407 | |||
| 408 | if module_deps.has_key(file): | ||
| 409 | import re | ||
| 410 | dependencies = [] | ||
| 411 | for i in module_deps[file]: | ||
| 412 | m = re.match(pattern, os.path.basename(i)) | ||
| 413 | if not m: | ||
| 414 | continue | ||
| 415 | on = legitimize_package_name(m.group(1)) | ||
| 416 | dependency_pkg = format % on | ||
| 417 | dependencies.append(dependency_pkg) | ||
| 418 | return dependencies | ||
| 419 | return [] | ||
| 420 | |||
| 421 | def frob_metadata(file, pkg, pattern, format, basename): | ||
| 422 | import re | ||
| 423 | vals = extract_modinfo(file) | ||
| 424 | |||
| 425 | dvar = bb.data.getVar('PKGD', d, 1) | ||
| 426 | |||
| 427 | # If autoloading is requested, output /etc/modutils/<name> and append | ||
| 428 | # appropriate modprobe commands to the postinst | ||
| 429 | autoload = bb.data.getVar('module_autoload_%s' % basename, d, 1) | ||
| 430 | if autoload: | ||
| 431 | name = '%s/etc/modutils/%s' % (dvar, basename) | ||
| 432 | f = open(name, 'w') | ||
| 433 | for m in autoload.split(): | ||
| 434 | f.write('%s\n' % m) | ||
| 435 | f.close() | ||
| 436 | postinst = bb.data.getVar('pkg_postinst_%s' % pkg, d, 1) | ||
| 437 | if not postinst: | ||
| 438 | bb.fatal("pkg_postinst_%s not defined" % pkg) | ||
| 439 | postinst += bb.data.getVar('autoload_postinst_fragment', d, 1) % autoload | ||
| 440 | bb.data.setVar('pkg_postinst_%s' % pkg, postinst, d) | ||
| 441 | |||
| 442 | # Write out any modconf fragment | ||
| 443 | modconf = bb.data.getVar('module_conf_%s' % basename, d, 1) | ||
| 444 | if modconf: | ||
| 445 | if bb.data.getVar("KERNEL_MAJOR_VERSION", d, 1) == "2.6": | ||
| 446 | name = '%s/etc/modprobe.d/%s.conf' % (dvar, basename) | ||
| 447 | else: | ||
| 448 | name = '%s/etc/modutils/%s.conf' % (dvar, basename) | ||
| 449 | f = open(name, 'w') | ||
| 450 | f.write("%s\n" % modconf) | ||
| 451 | f.close() | ||
| 452 | |||
| 453 | files = bb.data.getVar('FILES_%s' % pkg, d, 1) | ||
| 454 | files = "%s /etc/modutils/%s /etc/modutils/%s.conf /etc/modprobe.d/%s.conf" % (files, basename, basename, basename) | ||
| 455 | bb.data.setVar('FILES_%s' % pkg, files, d) | ||
| 456 | |||
| 457 | if vals.has_key("description"): | ||
| 458 | old_desc = bb.data.getVar('DESCRIPTION_' + pkg, d, 1) or "" | ||
| 459 | bb.data.setVar('DESCRIPTION_' + pkg, old_desc + "; " + vals["description"], d) | ||
| 460 | |||
| 461 | rdepends_str = bb.data.getVar('RDEPENDS_' + pkg, d, 1) | ||
| 462 | if rdepends_str: | ||
| 463 | rdepends = rdepends_str.split() | ||
| 464 | else: | ||
| 465 | rdepends = [] | ||
| 466 | rdepends.extend(get_dependencies(file, pattern, format)) | ||
| 467 | bb.data.setVar('RDEPENDS_' + pkg, ' '.join(rdepends), d) | ||
| 468 | |||
| 469 | module_deps = parse_depmod() | ||
| 470 | module_regex = '^(.*)\.k?o$' | ||
| 471 | module_pattern = 'kernel-module-%s' | ||
| 472 | |||
| 473 | postinst = bb.data.getVar('pkg_postinst_modules', d, 1) | ||
| 474 | postrm = bb.data.getVar('pkg_postrm_modules', d, 1) | ||
| 475 | do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.bin$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='') | ||
| 476 | do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.fw$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='') | ||
| 477 | do_split_packages(d, root='/lib/modules', file_regex=module_regex, output_pattern=module_pattern, description='%s kernel module', postinst=postinst, postrm=postrm, recursive=True, hook=frob_metadata, extra_depends='update-modules kernel-%s' % bb.data.getVar("KERNEL_VERSION", d, 1)) | ||
| 478 | |||
| 479 | import re | ||
| 480 | metapkg = "kernel-modules" | ||
| 481 | bb.data.setVar('ALLOW_EMPTY_' + metapkg, "1", d) | ||
| 482 | bb.data.setVar('FILES_' + metapkg, "", d) | ||
| 483 | blacklist = [ 'kernel-dev', 'kernel-image', 'kernel-base', 'kernel-vmlinux', 'perf' ] | ||
| 484 | for l in module_deps.values(): | ||
| 485 | for i in l: | ||
| 486 | pkg = module_pattern % legitimize_package_name(re.match(module_regex, os.path.basename(i)).group(1)) | ||
| 487 | blacklist.append(pkg) | ||
| 488 | metapkg_rdepends = [] | ||
| 489 | packages = bb.data.getVar('PACKAGES', d, 1).split() | ||
| 490 | for pkg in packages[1:]: | ||
| 491 | if not pkg in blacklist and not pkg in metapkg_rdepends: | ||
| 492 | metapkg_rdepends.append(pkg) | ||
| 493 | bb.data.setVar('RDEPENDS_' + metapkg, ' '.join(metapkg_rdepends), d) | ||
| 494 | bb.data.setVar('DESCRIPTION_' + metapkg, 'Kernel modules meta package', d) | ||
| 495 | packages.append(metapkg) | ||
| 496 | bb.data.setVar('PACKAGES', ' '.join(packages), d) | ||
| 497 | } | ||
| 498 | |||
| 499 | # Support checking the kernel size since some kernels need to reside in partitions | ||
| 500 | # with a fixed length or there is a limit in transferring the kernel to memory | ||
| 501 | do_sizecheck() { | ||
| 502 | if [ ! -z "${KERNEL_IMAGE_MAXSIZE}" ]; then | ||
| 503 | size=`ls -l arch/${ARCH}/boot/${KERNEL_IMAGETYPE} | awk '{ print $5}'` | ||
| 504 | if [ $size -ge ${KERNEL_IMAGE_MAXSIZE} ]; then | ||
| 505 | rm arch/${ARCH}/boot/${KERNEL_IMAGETYPE} | ||
| 506 | die "This kernel (size=$size > ${KERNEL_IMAGE_MAXSIZE}) is too big for your device. Please reduce the size of the kernel by making more of it modular." | ||
| 507 | fi | ||
| 508 | fi | ||
| 509 | } | ||
| 510 | |||
| 511 | addtask sizecheck before do_install after do_compile | ||
| 512 | |||
| 513 | do_uboot_mkimage() { | ||
| 514 | if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then | ||
| 515 | ENTRYPOINT=${UBOOT_ENTRYPOINT} | ||
| 516 | if test -n "${UBOOT_ENTRYSYMBOL}"; then | ||
| 517 | ENTRYPOINT=`${HOST_PREFIX}nm ${S}/vmlinux | \ | ||
| 518 | awk '$3=="${UBOOT_ENTRYSYMBOL}" {print $1}'` | ||
| 519 | fi | ||
| 520 | if test -e arch/${ARCH}/boot/compressed/vmlinux ; then | ||
| 521 | ${OBJCOPY} -O binary -R .note -R .comment -S arch/${ARCH}/boot/compressed/vmlinux linux.bin | ||
| 522 | uboot-mkimage -A ${UBOOT_ARCH} -O linux -T kernel -C none -a ${UBOOT_LOADADDRESS} -e $ENTRYPOINT -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin arch/${ARCH}/boot/uImage | ||
| 523 | rm -f linux.bin | ||
| 524 | else | ||
| 525 | ${OBJCOPY} -O binary -R .note -R .comment -S vmlinux linux.bin | ||
| 526 | rm -f linux.bin.gz | ||
| 527 | gzip -9 linux.bin | ||
| 528 | uboot-mkimage -A ${UBOOT_ARCH} -O linux -T kernel -C gzip -a ${UBOOT_LOADADDRESS} -e $ENTRYPOINT -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin.gz arch/${ARCH}/boot/uImage | ||
| 529 | rm -f linux.bin.gz | ||
| 530 | fi | ||
| 531 | fi | ||
| 532 | } | ||
| 533 | |||
| 534 | addtask uboot_mkimage before do_install after do_compile | ||
| 535 | |||
| 536 | KERNEL_IMAGE_BASE_NAME ?= "${KERNEL_IMAGETYPE}-${PV}-${PR}-${MACHINE}-${DATETIME}" | ||
| 537 | # Don't include the DATETIME variable in the sstate package signatures | ||
| 538 | KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME" | ||
| 539 | KERNEL_IMAGE_SYMLINK_NAME ?= "${KERNEL_IMAGETYPE}-${MACHINE}" | ||
| 540 | |||
| 541 | kernel_do_deploy() { | ||
| 542 | install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin | ||
| 543 | if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then | ||
| 544 | tar -cvzf ${DEPLOYDIR}/modules-${KERNEL_VERSION}-${PR}-${MACHINE}.tgz -C ${D} lib | ||
| 545 | fi | ||
| 546 | |||
| 547 | cd ${DEPLOYDIR} | ||
| 548 | rm -f ${KERNEL_IMAGE_SYMLINK_NAME}.bin | ||
| 549 | ln -sf ${KERNEL_IMAGE_BASE_NAME}.bin ${KERNEL_IMAGE_SYMLINK_NAME}.bin | ||
| 550 | } | ||
| 551 | do_deploy[dirs] = "${DEPLOYDIR} ${B}" | ||
| 552 | |||
| 553 | addtask deploy before do_package after do_install | ||
| 554 | |||
| 555 | EXPORT_FUNCTIONS do_deploy | ||
| 556 | |||
| 557 | # perf must be enabled in individual kernel recipes | ||
| 558 | PACKAGES =+ "perf" | ||
| 559 | FILES_perf = "${bindir}/* \ | ||
| 560 | ${libexecdir}" | ||
diff --git a/meta-oe/classes/mime.bbclass b/meta-oe/classes/mime.bbclass new file mode 100644 index 0000000000..b9cdd7becd --- /dev/null +++ b/meta-oe/classes/mime.bbclass | |||
| @@ -0,0 +1,56 @@ | |||
| 1 | DEPENDS += "shared-mime-info-native shared-mime-info" | ||
| 2 | |||
| 3 | mime_postinst() { | ||
| 4 | if [ "$1" = configure ]; then | ||
| 5 | if [ -x ${bindir}/update-mime-database ] ; then | ||
| 6 | echo "Updating MIME database... this may take a while." | ||
| 7 | update-mime-database $D${datadir}/mime | ||
| 8 | else | ||
| 9 | echo "Missing ${bindir}/update-mime-database, update of mime database failed!" | ||
| 10 | exit 1 | ||
| 11 | fi | ||
| 12 | fi | ||
| 13 | } | ||
| 14 | |||
| 15 | mime_postrm() { | ||
| 16 | if [ "$1" = remove ] || [ "$1" = upgrade ]; then | ||
| 17 | if [ -x ${bindir}/update-mime-database ] ; then | ||
| 18 | echo "Updating MIME database... this may take a while." | ||
| 19 | update-mime-database $D${datadir}/mime | ||
| 20 | else | ||
| 21 | echo "Missing ${bindir}/update-mime-database, update of mime database failed!" | ||
| 22 | exit 1 | ||
| 23 | fi | ||
| 24 | fi | ||
| 25 | } | ||
| 26 | |||
| 27 | python ppopulate_packages_append () { | ||
| 28 | import os.path, re | ||
| 29 | packages = bb.data.getVar('PACKAGES', d, 1).split() | ||
| 30 | pkgdest = bb.data.getVar('PKGDEST', d, 1) | ||
| 31 | |||
| 32 | for pkg in packages: | ||
| 33 | mime_dir = '%s/%s/usr/share/mime/packages' % (pkgdest, pkg) | ||
| 34 | mimes = [] | ||
| 35 | mime_re = re.compile(".*\.xml$") | ||
| 36 | if os.path.exists(mime_dir): | ||
| 37 | for f in os.listdir(mime_dir): | ||
| 38 | if mime_re.match(f): | ||
| 39 | mimes.append(f) | ||
| 40 | if mimes != []: | ||
| 41 | bb.note("adding mime postinst and postrm scripts to %s" % pkg) | ||
| 42 | postinst = bb.data.getVar('pkg_postinst_%s' % pkg, d, 1) or bb.data.getVar('pkg_postinst', d, 1) | ||
| 43 | if not postinst: | ||
| 44 | postinst = '#!/bin/sh\n' | ||
| 45 | postinst += bb.data.getVar('mime_postinst', d, 1) | ||
| 46 | bb.data.setVar('pkg_postinst_%s' % pkg, postinst, d) | ||
| 47 | postrm = bb.data.getVar('pkg_postrm_%s' % pkg, d, 1) or bb.data.getVar('pkg_postrm', d, 1) | ||
| 48 | if not postrm: | ||
| 49 | postrm = '#!/bin/sh\n' | ||
| 50 | postrm += bb.data.getVar('mime_postrm', d, 1) | ||
| 51 | bb.data.setVar('pkg_postrm_%s' % pkg, postrm, d) | ||
| 52 | bb.note("adding freedesktop-mime-info dependency to %s" % pkg) | ||
| 53 | rdepends = explode_deps(bb.data.getVar('RDEPENDS_' + pkg, d, 0) or bb.data.getVar('RDEPENDS', d, 0) or "") | ||
| 54 | rdepends.append("freedesktop-mime-info") | ||
| 55 | bb.data.setVar('RDEPENDS_' + pkg, " " + " ".join(rdepends), d) | ||
| 56 | } | ||
diff --git a/meta-oe/classes/qmake_base.bbclass b/meta-oe/classes/qmake_base.bbclass new file mode 100644 index 0000000000..577c0fab3b --- /dev/null +++ b/meta-oe/classes/qmake_base.bbclass | |||
| @@ -0,0 +1,91 @@ | |||
| 1 | |||
| 2 | OE_QMAKE_PLATFORM = "${TARGET_OS}-oe-g++" | ||
| 3 | QMAKESPEC = "${QMAKE_MKSPEC_PATH}/${OE_QMAKE_PLATFORM}" | ||
| 4 | |||
| 5 | # We override this completely to eliminate the -e normally passed in | ||
| 6 | EXTRA_OEMAKE = ' MAKEFLAGS= ' | ||
| 7 | |||
| 8 | export OE_QMAKE_CC="${CC}" | ||
| 9 | export OE_QMAKE_CFLAGS="${CFLAGS}" | ||
| 10 | export OE_QMAKE_CXX="${CXX}" | ||
| 11 | export OE_QMAKE_LDFLAGS="${LDFLAGS}" | ||
| 12 | export OE_QMAKE_AR="${AR}" | ||
| 13 | export OE_QMAKE_STRIP="echo" | ||
| 14 | export OE_QMAKE_RPATH="-Wl,-rpath-link," | ||
| 15 | |||
| 16 | # do not export STRIP to the environment | ||
| 17 | STRIP[unexport] = "1" | ||
| 18 | |||
| 19 | # default to qte2 via bb.conf, inherit qt3x11 to configure for qt3x11 | ||
| 20 | |||
| 21 | oe_qmake_mkspecs () { | ||
| 22 | mkdir -p mkspecs/${OE_QMAKE_PLATFORM} | ||
| 23 | for f in ${QMAKE_MKSPEC_PATH}/${OE_QMAKE_PLATFORM}/*; do | ||
| 24 | if [ -L $f ]; then | ||
| 25 | lnk=`readlink $f` | ||
| 26 | if [ -f mkspecs/${OE_QMAKE_PLATFORM}/$lnk ]; then | ||
| 27 | ln -s $lnk mkspecs/${OE_QMAKE_PLATFORM}/`basename $f` | ||
| 28 | else | ||
| 29 | cp $f mkspecs/${OE_QMAKE_PLATFORM}/ | ||
| 30 | fi | ||
| 31 | else | ||
| 32 | cp $f mkspecs/${OE_QMAKE_PLATFORM}/ | ||
| 33 | fi | ||
| 34 | done | ||
| 35 | } | ||
| 36 | |||
| 37 | qmake_base_do_configure() { | ||
| 38 | case ${QMAKESPEC} in | ||
| 39 | *linux-oe-g++|*linux-uclibc-oe-g++|*linux-gnueabi-oe-g++|*linux-uclibceabi-oe-g++) | ||
| 40 | ;; | ||
| 41 | *-oe-g++) | ||
| 42 | die Unsupported target ${TARGET_OS} for oe-g++ qmake spec | ||
| 43 | ;; | ||
| 44 | *) | ||
| 45 | oenote Searching for qmake spec file | ||
| 46 | paths="${QMAKE_MKSPEC_PATH}/qws/${TARGET_OS}-${TARGET_ARCH}-g++" | ||
| 47 | paths="${QMAKE_MKSPEC_PATH}/${TARGET_OS}-g++ $paths" | ||
| 48 | |||
| 49 | if (echo "${TARGET_ARCH}"|grep -q 'i.86'); then | ||
| 50 | paths="${QMAKE_MKSPEC_PATH}/qws/${TARGET_OS}-x86-g++ $paths" | ||
| 51 | fi | ||
| 52 | for i in $paths; do | ||
| 53 | if test -e $i; then | ||
| 54 | export QMAKESPEC=$i | ||
| 55 | break | ||
| 56 | fi | ||
| 57 | done | ||
| 58 | ;; | ||
| 59 | esac | ||
| 60 | |||
| 61 | oenote "using qmake spec in ${QMAKESPEC}, using profiles '${QMAKE_PROFILES}'" | ||
| 62 | |||
| 63 | if [ -z "${QMAKE_PROFILES}" ]; then | ||
| 64 | PROFILES="`ls *.pro`" | ||
| 65 | else | ||
| 66 | PROFILES="${QMAKE_PROFILES}" | ||
| 67 | fi | ||
| 68 | |||
| 69 | if [ -z "$PROFILES" ]; then | ||
| 70 | die "QMAKE_PROFILES not set and no profiles found in $PWD" | ||
| 71 | fi | ||
| 72 | |||
| 73 | if [ ! -z "${EXTRA_QMAKEVARS_POST}" ]; then | ||
| 74 | AFTER="-after" | ||
| 75 | QMAKE_VARSUBST_POST="${EXTRA_QMAKEVARS_POST}" | ||
| 76 | oenote "qmake postvar substitution: ${EXTRA_QMAKEVARS_POST}" | ||
| 77 | fi | ||
| 78 | |||
| 79 | if [ ! -z "${EXTRA_QMAKEVARS_PRE}" ]; then | ||
| 80 | QMAKE_VARSUBST_PRE="${EXTRA_QMAKEVARS_PRE}" | ||
| 81 | oenote "qmake prevar substitution: ${EXTRA_QMAKEVARS_PRE}" | ||
| 82 | fi | ||
| 83 | |||
| 84 | #oenote "Calling '${OE_QMAKE_QMAKE} -makefile -spec ${QMAKESPEC} -o Makefile $QMAKE_VARSUBST_PRE $AFTER $PROFILES $QMAKE_VARSUBST_POST'" | ||
| 85 | unset QMAKESPEC || true | ||
| 86 | ${OE_QMAKE_QMAKE} -makefile -spec ${QMAKESPEC} -o Makefile $QMAKE_VARSUBST_PRE $AFTER $PROFILES $QMAKE_VARSUBST_POST || die "Error calling ${OE_QMAKE_QMAKE} on $PROFILES" | ||
| 87 | } | ||
| 88 | |||
| 89 | EXPORT_FUNCTIONS do_configure | ||
| 90 | |||
| 91 | addtask configure after do_unpack do_patch before do_compile | ||
diff --git a/meta-oe/classes/qt4e.bbclass b/meta-oe/classes/qt4e.bbclass new file mode 100644 index 0000000000..303b79b8a6 --- /dev/null +++ b/meta-oe/classes/qt4e.bbclass | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | DEPENDS_prepend = "${@["qt4-embedded ", ""][(bb.data.getVar('PN', d, 1)[:12] == 'qt4-embedded')]}" | ||
| 2 | inherit qmake2 | ||
| 3 | |||
| 4 | QT_DIR_NAME = "qtopia" | ||
| 5 | QT_LIBINFIX = "E" | ||
| 6 | # override variables set by qmake-base to compile Qt/Embedded apps | ||
| 7 | # | ||
| 8 | export QMAKESPEC = "${STAGING_DATADIR}/${QT_DIR_NAME}/mkspecs/${TARGET_OS}-oe-g++" | ||
| 9 | export OE_QMAKE_INCDIR_QT = "${STAGING_INCDIR}/${QT_DIR_NAME}" | ||
| 10 | export OE_QMAKE_LIBDIR_QT = "${STAGING_LIBDIR}" | ||
| 11 | export OE_QMAKE_LIBS_QT = "qt" | ||
| 12 | export OE_QMAKE_LIBS_X11 = "" | ||
| 13 | export OE_QMAKE_EXTRA_MODULES = "network" | ||
| 14 | EXTRA_QMAKEVARS_PRE += " QT_LIBINFIX=${QT_LIBINFIX} " | ||
| 15 | |||
| 16 | # Qt4 uses atomic instructions not supported in thumb mode | ||
| 17 | ARM_INSTRUCTION_SET = "arm" | ||
diff --git a/meta-oe/classes/siteinfo.bbclass b/meta-oe/classes/siteinfo.bbclass new file mode 100644 index 0000000000..c0db539e29 --- /dev/null +++ b/meta-oe/classes/siteinfo.bbclass | |||
| @@ -0,0 +1,218 @@ | |||
| 1 | # This class exists to provide information about the targets that | ||
| 2 | # may be needed by other classes and/or recipes. If you add a new | ||
| 3 | # target this will probably need to be updated. | ||
| 4 | |||
| 5 | # | ||
| 6 | # Returns information about 'what' for the named target 'target' | ||
| 7 | # where 'target' == "<arch>-<os>" | ||
| 8 | # | ||
| 9 | # 'what' can be one of | ||
| 10 | # * target: Returns the target name ("<arch>-<os>") | ||
| 11 | # * endianess: Return "be" for big endian targets, "le" for little endian | ||
| 12 | # * bits: Returns the bit size of the target, either "32" or "64" | ||
| 13 | # * libc: Returns the name of the c library used by the target | ||
| 14 | # | ||
| 15 | # It is an error for the target not to exist. | ||
| 16 | # If 'what' doesn't exist then an empty value is returned | ||
| 17 | # | ||
| 18 | def siteinfo_data(d): | ||
| 19 | archinfo = { | ||
| 20 | "arm": "endian-little bit-32 arm-common", | ||
| 21 | "armeb": "endian-big bit-32 arm-common", | ||
| 22 | "avr32": "endian-big bit-32 avr32-common", | ||
| 23 | "bfin": "endian-little bit-32 bfin-common", | ||
| 24 | "i386": "endian-little bit-32 ix86-common", | ||
| 25 | "i486": "endian-little bit-32 ix86-common", | ||
| 26 | "i586": "endian-little bit-32 ix86-common", | ||
| 27 | "i686": "endian-little bit-32 ix86-common", | ||
| 28 | "ia64": "endian-little bit-64", | ||
| 29 | "mips": "endian-big bit-32 mips-common", | ||
| 30 | "mips64": "endian-big bit-64 mips64-common", | ||
| 31 | "mips64el": "endian-little bit-64 mips64-common", | ||
| 32 | "mipsel": "endian-little bit-32 mips-common", | ||
| 33 | "powerpc": "endian-big bit-32 powerpc-common", | ||
| 34 | "nios2": "endian-little bit-32 nios2-common", | ||
| 35 | "powerpc64": "endian-big bit-64 powerpc-common powerpc64-linux", | ||
| 36 | "ppc": "endian-big bit-32 powerpc-common", | ||
| 37 | "ppc64": "endian-big bit-64 powerpc-common powerpc64-linux", | ||
| 38 | "sh3": "endian-little bit-32 sh-common", | ||
| 39 | "sh4": "endian-little bit-32 sh-common", | ||
| 40 | "sparc": "endian-big bit-32", | ||
| 41 | "viac3": "endian-little bit-32 ix86-common", | ||
| 42 | "x86_64": "endian-little bit-64", | ||
| 43 | } | ||
| 44 | osinfo = { | ||
| 45 | "darwin": "common-darwin", | ||
| 46 | "darwin9": "common-darwin", | ||
| 47 | "linux": "common-linux common-glibc", | ||
| 48 | "linux-gnueabi": "common-linux common-glibc", | ||
| 49 | "linux-gnuspe": "common-linux common-glibc", | ||
| 50 | "linux-uclibc": "common-linux common-uclibc", | ||
| 51 | "linux-uclibceabi": "common-linux common-uclibc", | ||
| 52 | "linux-uclibcspe": "common-linux common-uclibc", | ||
| 53 | "uclinux-uclibc": "common-uclibc", | ||
| 54 | "cygwin": "common-cygwin", | ||
| 55 | "mingw32": "common-mingw", | ||
| 56 | } | ||
| 57 | targetinfo = { | ||
| 58 | "arm-linux-gnueabi": "arm-linux", | ||
| 59 | "arm-linux-uclibceabi": "arm-linux-uclibc", | ||
| 60 | "armeb-linux-gnueabi": "armeb-linux", | ||
| 61 | "armeb-linux-uclibceabi": "armeb-linux-uclibc", | ||
| 62 | "powerpc-linux-gnuspe": "powerpc-linux", | ||
| 63 | "powerpc-linux-uclibcspe": "powerpc-linux-uclibc", | ||
| 64 | } | ||
| 65 | |||
| 66 | arch = d.getVar("HOST_ARCH", True) | ||
| 67 | os = d.getVar("HOST_OS", True) | ||
| 68 | target = "%s-%s" % (arch, os) | ||
| 69 | |||
| 70 | sitedata = [] | ||
| 71 | if arch in archinfo: | ||
| 72 | sitedata.extend(archinfo[arch].split()) | ||
| 73 | if os in osinfo: | ||
| 74 | sitedata.extend(osinfo[os].split()) | ||
| 75 | if target in targetinfo: | ||
| 76 | sitedata.extend(targetinfo[target].split()) | ||
| 77 | sitedata.append(target) | ||
| 78 | sitedata.append("common") | ||
| 79 | |||
| 80 | return sitedata | ||
| 81 | |||
| 82 | python () { | ||
| 83 | sitedata = set(siteinfo_data(d)) | ||
| 84 | if "endian-little" in sitedata: | ||
| 85 | d.setVar("SITEINFO_ENDIANNESS", "le") | ||
| 86 | elif "endian-big" in sitedata: | ||
| 87 | d.setVar("SITEINFO_ENDIANNESS", "be") | ||
| 88 | else: | ||
| 89 | bb.error("Unable to determine endianness for architecture '%s'" % | ||
| 90 | d.getVar("HOST_ARCH", True)) | ||
| 91 | bb.fatal("Please add your architecture to siteinfo.bbclass") | ||
| 92 | |||
| 93 | if "bit-32" in sitedata: | ||
| 94 | d.setVar("SITEINFO_BITS", "32") | ||
| 95 | elif "bit-64" in sitedata: | ||
| 96 | d.setVar("SITEINFO_BITS", "64") | ||
| 97 | else: | ||
| 98 | bb.error("Unable to determine bit size for architecture '%s'" % | ||
| 99 | d.getVar("HOST_ARCH", True)) | ||
| 100 | bb.fatal("Please add your architecture to siteinfo.bbclass") | ||
| 101 | } | ||
| 102 | |||
| 103 | # Old class from yocto pasted in below for compat | ||
| 104 | |||
| 105 | def get_siteinfo_list(d): | ||
| 106 | target = bb.data.getVar('HOST_ARCH', d, 1) + "-" + bb.data.getVar('HOST_OS', d, 1) | ||
| 107 | |||
| 108 | targetinfo = {\ | ||
| 109 | "armeb-linux": "endian-big bit-32 common-glibc arm-common",\ | ||
| 110 | "armeb-linux-gnueabi": "endian-big bit-32 common-glibc arm-common armeb-linux",\ | ||
| 111 | "armeb-linux-uclibc": "endian-big bit-32 common-uclibc arm-common",\ | ||
| 112 | "armeb-linux-uclibcgnueabi": "endian-big bit-32 common-uclibc arm-common armeb-linux-uclibc",\ | ||
| 113 | "arm-darwin": "endian-little bit-32 common-darwin",\ | ||
| 114 | "arm-darwin8": "endian-little bit-32 common-darwin",\ | ||
| 115 | "arm-linux": "endian-little bit-32 common-glibc arm-common",\ | ||
| 116 | "arm-linux-gnueabi": "endian-little bit-32 common-glibc arm-common arm-linux",\ | ||
| 117 | "arm-linux-uclibc": "endian-little bit-32 common-uclibc arm-common",\ | ||
| 118 | "arm-linux-uclibcgnueabi": "endian-little bit-32 common-uclibc arm-common arm-linux-uclibc",\ | ||
| 119 | "avr32-linux": "endian-big bit-32 common-glibc avr32-common",\ | ||
| 120 | "avr32-linux-uclibc": "endian-big bit-32 common-uclibc avr32-common",\ | ||
| 121 | "bfin-uclinux-uclibc": "endian-little bit-32 common-uclibc bfin-common",\ | ||
| 122 | "i386-linux": "endian-little bit-32 common-glibc ix86-common",\ | ||
| 123 | "i486-linux": "endian-little bit-32 common-glibc ix86-common",\ | ||
| 124 | "i586-linux": "endian-little bit-32 common-glibc ix86-common",\ | ||
| 125 | "i686-linux": "endian-little bit-32 common-glibc ix86-common",\ | ||
| 126 | "i386-linux-uclibc": "endian-little bit-32 common-uclibc ix86-common",\ | ||
| 127 | "i486-linux-uclibc": "endian-little bit-32 common-uclibc ix86-common",\ | ||
| 128 | "i586-linux-uclibc": "endian-little bit-32 common-uclibc ix86-common",\ | ||
| 129 | "i686-linux-uclibc": "endian-little bit-32 common-uclibc ix86-common",\ | ||
| 130 | "mipsel-linux": "endian-little bit-32 common-glibc mips-common",\ | ||
| 131 | "mipsel-linux-uclibc": "endian-little bit-32 common-uclibc mips-common",\ | ||
| 132 | "mips-linux": "endian-big bit-32 common-glibc mips-common",\ | ||
| 133 | "mips-linux-uclibc": "endian-big bit-32 common-uclibc mips-common",\ | ||
| 134 | "powerpc-darwin": "endian-big bit-32 common-darwin",\ | ||
| 135 | "ppc-linux": "endian-big bit-32 common-glibc powerpc-common",\ | ||
| 136 | "powerpc-linux": "endian-big bit-32 common-glibc powerpc-common",\ | ||
| 137 | "powerpc-linux-uclibc": "endian-big bit-32 common-uclibc powerpc-common",\ | ||
| 138 | "sh3-linux": "endian-little bit-32 common-glibc sh-common",\ | ||
| 139 | "sh4-linux": "endian-little bit-32 common-glibc sh-common",\ | ||
| 140 | "sh4-linux-uclibc": "endian-little bit-32 common-uclibc sh-common",\ | ||
| 141 | "sparc-linux": "endian-big bit-32 common-glibc",\ | ||
| 142 | "x86_64-linux": "endian-little bit-64 common-glibc",\ | ||
| 143 | "x86_64-linux-uclibc": "endian-little bit-64 common-uclibc"} | ||
| 144 | if target in targetinfo: | ||
| 145 | info = targetinfo[target].split() | ||
| 146 | info.append(target) | ||
| 147 | info.append("common") | ||
| 148 | return info | ||
| 149 | else: | ||
| 150 | bb.error("Information not available for target '%s'" % target) | ||
| 151 | |||
| 152 | |||
| 153 | # | ||
| 154 | # Define which site files to use. We check for several site files and | ||
| 155 | # use each one that is found, based on the list returned by get_siteinfo_list() | ||
| 156 | # | ||
| 157 | # Search for the files in the following directories: | ||
| 158 | # 1) ${BBPATH}/site (in reverse) - app specific, then site wide | ||
| 159 | # 2) ${FILE_DIRNAME}/site-${PV} - app version specific | ||
| 160 | # | ||
| 161 | def siteinfo_get_files(d): | ||
| 162 | sitefiles = "" | ||
| 163 | |||
| 164 | # Determine which site files to look for | ||
| 165 | sites = get_siteinfo_list(d) | ||
| 166 | |||
| 167 | # Check along bbpath for site files and append in reverse order so | ||
| 168 | # the application specific sites files are last and system site | ||
| 169 | # files first. | ||
| 170 | path_bb = bb.data.getVar('BBPATH', d, 1) | ||
| 171 | for p in (path_bb or "").split(':'): | ||
| 172 | tmp = "" | ||
| 173 | for i in sites: | ||
| 174 | fname = os.path.join(p, 'site', i) | ||
| 175 | if os.path.exists(fname): | ||
| 176 | tmp += fname + " " | ||
| 177 | sitefiles = tmp + sitefiles; | ||
| 178 | |||
| 179 | # Now check for the applications version specific site files | ||
| 180 | path_pkgv = os.path.join(bb.data.getVar('FILE_DIRNAME', d, 1), "site-" + bb.data.getVar('PV', d, 1)) | ||
| 181 | for i in sites: | ||
| 182 | fname = os.path.join(path_pkgv, i) | ||
| 183 | if os.path.exists(fname): | ||
| 184 | sitefiles += fname + " " | ||
| 185 | |||
| 186 | # Now check for siteconfig cache files | ||
| 187 | path_siteconfig = bb.data.getVar('SITECONFIG_SYSROOTCACHE', d, 1) | ||
| 188 | if os.path.isdir(path_siteconfig): | ||
| 189 | for i in os.listdir(path_siteconfig): | ||
| 190 | fname = os.path.join(path_siteconfig, i) | ||
| 191 | sitefiles += fname + " " | ||
| 192 | |||
| 193 | bb.debug(1, "SITE files " + sitefiles); | ||
| 194 | return sitefiles | ||
| 195 | |||
| 196 | def siteinfo_get_endianess(d): | ||
| 197 | info = get_siteinfo_list(d) | ||
| 198 | if 'endian-little' in info: | ||
| 199 | return "le" | ||
| 200 | elif 'endian-big' in info: | ||
| 201 | return "be" | ||
| 202 | bb.error("Site info could not determine endianess for target") | ||
| 203 | |||
| 204 | def siteinfo_get_bits(d): | ||
| 205 | info = get_siteinfo_list(d) | ||
| 206 | if 'bit-32' in info: | ||
| 207 | return "32" | ||
| 208 | elif 'bit-64' in info: | ||
| 209 | return "64" | ||
| 210 | bb.error("Site info could not determine bit size for target") | ||
| 211 | |||
| 212 | # | ||
| 213 | # Make some information available via variables | ||
| 214 | # | ||
| 215 | SITEINFO_ENDIANESS = "${@siteinfo_get_endianess(d)}" | ||
| 216 | SITEINFO_BITS = "${@siteinfo_get_bits(d)}" | ||
| 217 | SITECONFIG_SYSROOTCACHE = "${STAGING_DATADIR}/${TARGET_SYS}_config_site.d" | ||
| 218 | |||
