summaryrefslogtreecommitdiffstats
path: root/classes
diff options
context:
space:
mode:
authorKoen Kooi <koen@dominion.thruhere.net>2011-01-03 11:07:49 +0100
committerKoen Kooi <koen@dominion.thruhere.net>2011-01-03 12:02:35 +0100
commit63057a32d7b877c39b85eb3e9168c6fd7e4ce579 (patch)
tree5e3c5c688c4f98a325f0abdc64f4f57e611f5d8e /classes
parent5d5148b88be7fdee6f68df2c8e27f5bdd76c6141 (diff)
downloadmeta-openembedded-63057a32d7b877c39b85eb3e9168c6fd7e4ce579.tar.gz
qmake2: import from OE
We want to have a seperate qmake for the time being, but eventually all tweaks should move into qt4-tools Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'classes')
-rw-r--r--classes/qmake_base.bbclass91
1 files changed, 91 insertions, 0 deletions
diff --git a/classes/qmake_base.bbclass b/classes/qmake_base.bbclass
new file mode 100644
index 0000000000..577c0fab3b
--- /dev/null
+++ b/classes/qmake_base.bbclass
@@ -0,0 +1,91 @@
1
2OE_QMAKE_PLATFORM = "${TARGET_OS}-oe-g++"
3QMAKESPEC = "${QMAKE_MKSPEC_PATH}/${OE_QMAKE_PLATFORM}"
4
5# We override this completely to eliminate the -e normally passed in
6EXTRA_OEMAKE = ' MAKEFLAGS= '
7
8export OE_QMAKE_CC="${CC}"
9export OE_QMAKE_CFLAGS="${CFLAGS}"
10export OE_QMAKE_CXX="${CXX}"
11export OE_QMAKE_LDFLAGS="${LDFLAGS}"
12export OE_QMAKE_AR="${AR}"
13export OE_QMAKE_STRIP="echo"
14export OE_QMAKE_RPATH="-Wl,-rpath-link,"
15
16# do not export STRIP to the environment
17STRIP[unexport] = "1"
18
19# default to qte2 via bb.conf, inherit qt3x11 to configure for qt3x11
20
21oe_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
37qmake_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
89EXPORT_FUNCTIONS do_configure
90
91addtask configure after do_unpack do_patch before do_compile