diff options
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/qmake2.bbclass | 20 | ||||
-rw-r--r-- | meta/classes/qmake_base.bbclass | 88 |
2 files changed, 108 insertions, 0 deletions
diff --git a/meta/classes/qmake2.bbclass b/meta/classes/qmake2.bbclass new file mode 100644 index 0000000000..d0f59d2cd4 --- /dev/null +++ b/meta/classes/qmake2.bbclass | |||
@@ -0,0 +1,20 @@ | |||
1 | # | ||
2 | # QMake variables for Qt4 | ||
3 | # | ||
4 | inherit qmake_base | ||
5 | |||
6 | DEPENDS_prepend = "qmake2-native uicmoc4-native " | ||
7 | |||
8 | export QTDIR = "${STAGING_DIR}/${HOST_SYS}/qt4" | ||
9 | export QMAKESPEC = "${QTDIR}/mkspecs/${TARGET_OS}-oe-g++" | ||
10 | export OE_QMAKE_UIC = "${STAGING_BINDIR_NATIVE}/uic4" | ||
11 | export OE_QMAKE_UIC3 = "${STAGING_BINDIR_NATIVE}/uic34" | ||
12 | export OE_QMAKE_MOC = "${STAGING_BINDIR_NATIVE}/moc4" | ||
13 | export OE_QMAKE_RCC = "${STAGING_BINDIR_NATIVE}/rcc4" | ||
14 | export OE_QMAKE_QMAKE = "${STAGING_BINDIR_NATIVE}/qmake2" | ||
15 | export OE_QMAKE_LINK = "${CXX}" | ||
16 | export OE_QMAKE_CXXFLAGS = "${CXXFLAGS}" | ||
17 | export OE_QMAKE_INCDIR_QT = "${QTDIR}/include" | ||
18 | export OE_QMAKE_LIBDIR_QT = "${QTDIR}/lib" | ||
19 | export OE_QMAKE_LIBS_QT = "qt" | ||
20 | export OE_QMAKE_LIBS_X11 = "-lXext -lX11 -lm" | ||
diff --git a/meta/classes/qmake_base.bbclass b/meta/classes/qmake_base.bbclass new file mode 100644 index 0000000000..ea8903c278 --- /dev/null +++ b/meta/classes/qmake_base.bbclass | |||
@@ -0,0 +1,88 @@ | |||
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 | # default to qte2 via bb.conf, inherit qt3x11 to configure for qt3x11 | ||
17 | |||
18 | oe_qmake_mkspecs () { | ||
19 | mkdir -p mkspecs/${OE_QMAKE_PLATFORM} | ||
20 | for f in ${QMAKE_MKSPEC_PATH}/${OE_QMAKE_PLATFORM}/*; do | ||
21 | if [ -L $f ]; then | ||
22 | lnk=`readlink $f` | ||
23 | if [ -f mkspecs/${OE_QMAKE_PLATFORM}/$lnk ]; then | ||
24 | ln -s $lnk mkspecs/${OE_QMAKE_PLATFORM}/`basename $f` | ||
25 | else | ||
26 | cp $f mkspecs/${OE_QMAKE_PLATFORM}/ | ||
27 | fi | ||
28 | else | ||
29 | cp $f mkspecs/${OE_QMAKE_PLATFORM}/ | ||
30 | fi | ||
31 | done | ||
32 | } | ||
33 | |||
34 | qmake_base_do_configure() { | ||
35 | case ${QMAKESPEC} in | ||
36 | *linux-oe-g++|*linux-uclibc-oe-g++|*linux-gnueabi-oe-g++) | ||
37 | ;; | ||
38 | *-oe-g++) | ||
39 | die Unsupported target ${TARGET_OS} for oe-g++ qmake spec | ||
40 | ;; | ||
41 | *) | ||
42 | oenote Searching for qmake spec file | ||
43 | paths="${QMAKE_MKSPEC_PATH}/qws/${TARGET_OS}-${TARGET_ARCH}-g++" | ||
44 | paths="${QMAKE_MKSPEC_PATH}/${TARGET_OS}-g++ $paths" | ||
45 | |||
46 | if (echo "${TARGET_ARCH}"|grep -q 'i.86'); then | ||
47 | paths="${QMAKE_MKSPEC_PATH}/qws/${TARGET_OS}-x86-g++ $paths" | ||
48 | fi | ||
49 | for i in $paths; do | ||
50 | if test -e $i; then | ||
51 | export QMAKESPEC=$i | ||
52 | break | ||
53 | fi | ||
54 | done | ||
55 | ;; | ||
56 | esac | ||
57 | |||
58 | oenote "using qmake spec in ${QMAKESPEC}, using profiles '${QMAKE_PROFILES}'" | ||
59 | |||
60 | if [ -z "${QMAKE_PROFILES}" ]; then | ||
61 | PROFILES="`ls *.pro`" | ||
62 | else | ||
63 | PROFILES="${QMAKE_PROFILES}" | ||
64 | fi | ||
65 | |||
66 | if [ -z "$PROFILES" ]; then | ||
67 | die "QMAKE_PROFILES not set and no profiles found in $PWD" | ||
68 | fi | ||
69 | |||
70 | if [ ! -z "${EXTRA_QMAKEVARS_POST}" ]; then | ||
71 | AFTER="-after" | ||
72 | QMAKE_VARSUBST_POST="${EXTRA_QMAKEVARS_POST}" | ||
73 | oenote "qmake postvar substitution: ${EXTRA_QMAKEVARS_POST}" | ||
74 | fi | ||
75 | |||
76 | if [ ! -z "${EXTRA_QMAKEVARS_PRE}" ]; then | ||
77 | QMAKE_VARSUBST_PRE="${EXTRA_QMAKEVARS_PRE}" | ||
78 | oenote "qmake prevar substitution: ${EXTRA_QMAKEVARS_PRE}" | ||
79 | fi | ||
80 | |||
81 | #oenote "Calling '${OE_QMAKE_QMAKE} -makefile -spec ${QMAKESPEC} -o Makefile $QMAKE_VARSUBST_PRE $AFTER $PROFILES $QMAKE_VARSUBST_POST'" | ||
82 | unset QMAKESPEC || true | ||
83 | ${OE_QMAKE_QMAKE} -makefile -spec ${QMAKESPEC} -o Makefile $QMAKE_VARSUBST_PRE $AFTER $PROFILES $QMAKE_VARSUBST_POST || die "Error calling ${OE_QMAKE_QMAKE} on $PROFILES" | ||
84 | } | ||
85 | |||
86 | EXPORT_FUNCTIONS do_configure | ||
87 | |||
88 | addtask configure after do_unpack do_patch before do_compile | ||