summaryrefslogtreecommitdiffstats
path: root/classes/qmake_base.bbclass
diff options
context:
space:
mode:
authorAdrian Dudau <adrian.dudau@enea.com>2016-03-07 14:30:00 +0100
committerPaul Eggleton <paul.eggleton@linux.intel.com>2016-08-29 12:03:54 +1200
commitf33b73a9563f2dfdfd0ee37b61d65d90197a456f (patch)
tree978b77c965af2e1feeb734e2ae8fd4f9be7bc886 /classes/qmake_base.bbclass
parent44cbc64ccaee2050d1c1d5755023c0bf604615a1 (diff)
downloadmeta-qt3-f33b73a9563f2dfdfd0ee37b61d65d90197a456f.tar.gz
The class was removed from oe classes, but some recipes like qt-x11-free still inherit it. Keep the class within the layer to acommmodate them. Signed-off-by: Adrian Dudau <adrian.dudau@enea.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'classes/qmake_base.bbclass')
-rw-r--r--classes/qmake_base.bbclass119
1 files changed, 119 insertions, 0 deletions
diff --git a/classes/qmake_base.bbclass b/classes/qmake_base.bbclass
new file mode 100644
index 0000000..dc98713
--- /dev/null
+++ b/classes/qmake_base.bbclass
@@ -0,0 +1,119 @@
1QMAKE_MKSPEC_PATH ?= "${STAGING_DATADIR_NATIVE}/qmake"
2
3OE_QMAKE_PLATFORM = "${TARGET_OS}-oe-g++"
4QMAKESPEC := "${QMAKE_MKSPEC_PATH}/${OE_QMAKE_PLATFORM}"
5
6# We override this completely to eliminate the -e normally passed in
7EXTRA_OEMAKE = ""
8
9export OE_QMAKE_CC="${CC}"
10export OE_QMAKE_CFLAGS="${CFLAGS}"
11export OE_QMAKE_CXX="${CXX}"
12export OE_QMAKE_LDFLAGS="${LDFLAGS}"
13export OE_QMAKE_AR="${AR}"
14export OE_QMAKE_STRIP="echo"
15export OE_QMAKE_RPATH="-Wl,-rpath-link,"
16
17# default to qte2 via bb.conf, inherit qt3x11 to configure for qt3x11
18
19oe_qmake_mkspecs () {
20 mkdir -p mkspecs/${OE_QMAKE_PLATFORM}
21 for f in ${QMAKE_MKSPEC_PATH}/${OE_QMAKE_PLATFORM}/*; do
22 if [ -L $f ]; then
23 lnk=`readlink $f`
24 if [ -f mkspecs/${OE_QMAKE_PLATFORM}/$lnk ]; then
25 ln -s $lnk mkspecs/${OE_QMAKE_PLATFORM}/`basename $f`
26 else
27 cp $f mkspecs/${OE_QMAKE_PLATFORM}/
28 fi
29 else
30 cp $f mkspecs/${OE_QMAKE_PLATFORM}/
31 fi
32 done
33}
34
35do_generate_qt_config_file() {
36 export QT_CONF_PATH=${WORKDIR}/qt.conf
37 cat > ${WORKDIR}/qt.conf <<EOF
38[Paths]
39Prefix =
40Binaries = ${STAGING_BINDIR_NATIVE}
41Headers = ${STAGING_INCDIR}/${QT_DIR_NAME}
42Plugins = ${STAGING_LIBDIR}/${QT_DIR_NAME}/plugins/
43Mkspecs = ${STAGING_DATADIR}/${QT_DIR_NAME}/mkspecs/
44EOF
45}
46
47addtask generate_qt_config_file after do_patch before do_configure
48
49qmake_base_do_configure() {
50 case ${QMAKESPEC} in
51 *linux-oe-g++|*linux-uclibc-oe-g++|*linux-gnueabi-oe-g++|*linux-uclibceabi-oe-g++|*linux-gnuspe-oe-g++|*linux-uclibcspe-oe-g++|*linux-gnun32-oe-g++)
52 ;;
53 *-oe-g++)
54 die Unsupported target ${TARGET_OS} for oe-g++ qmake spec
55 ;;
56 *)
57 bbnote Searching for qmake spec file
58 paths="${QMAKE_MKSPEC_PATH}/qws/${TARGET_OS}-${TARGET_ARCH}-g++"
59 paths="${QMAKE_MKSPEC_PATH}/${TARGET_OS}-g++ $paths"
60
61 if (echo "${TARGET_ARCH}"|grep -q 'i.86'); then
62 paths="${QMAKE_MKSPEC_PATH}/qws/${TARGET_OS}-x86-g++ $paths"
63 fi
64 for i in $paths; do
65 if test -e $i; then
66 export QMAKESPEC=$i
67 break
68 fi
69 done
70 ;;
71 esac
72
73 bbnote "using qmake spec in ${QMAKESPEC}, using profiles '${QMAKE_PROFILES}'"
74
75 if [ -z "${QMAKE_PROFILES}" ]; then
76 PROFILES="`ls *.pro`"
77 else
78 PROFILES="${QMAKE_PROFILES}"
79 fi
80
81 if [ -z "$PROFILES" ]; then
82 die "QMAKE_PROFILES not set and no profiles found in $PWD"
83 fi
84
85 if [ ! -z "${EXTRA_QMAKEVARS_POST}" ]; then
86 AFTER="-after"
87 QMAKE_VARSUBST_POST="${EXTRA_QMAKEVARS_POST}"
88 bbnote "qmake postvar substitution: ${EXTRA_QMAKEVARS_POST}"
89 fi
90
91 if [ ! -z "${EXTRA_QMAKEVARS_PRE}" ]; then
92 QMAKE_VARSUBST_PRE="${EXTRA_QMAKEVARS_PRE}"
93 bbnote "qmake prevar substitution: ${EXTRA_QMAKEVARS_PRE}"
94 fi
95
96 # Hack .pro files to use OE utilities
97 LCONVERT_NAME=$(basename ${OE_QMAKE_LCONVERT})
98 LRELEASE_NAME=$(basename ${OE_QMAKE_LRELEASE})
99 LUPDATE_NAME=$(basename ${OE_QMAKE_LUPDATE})
100 XMLPATTERNS_NAME=$(basename ${OE_QMAKE_XMLPATTERNS})
101 find -name '*.pro' \
102 -exec sed -i -e "s|\(=\s*.*\)/$LCONVERT_NAME|\1/lconvert|g" \
103 -e "s|\(=\s*.*\)/$LRELEASE_NAME|\1/lrelease|g" \
104 -e "s|\(=\s*.*\)/$LUPDATE_NAME|\1/lupdate|g" \
105 -e "s|\(=\s*.*\)/$XMLPATTERNS_NAME|\1/xmlpatterns|g" \
106 -e "s|\(=\s*.*\)/lconvert|\1/$LCONVERT_NAME|g" \
107 -e "s|\(=\s*.*\)/lrelease|\1/$LRELEASE_NAME|g" \
108 -e "s|\(=\s*.*\)/lupdate|\1/$LUPDATE_NAME|g" \
109 -e "s|\(=\s*.*\)/xmlpatterns|\1/$XMLPATTERNS_NAME|g" \
110 '{}' ';'
111
112#bbnote "Calling '${OE_QMAKE_QMAKE} -makefile -spec ${QMAKESPEC} -o Makefile $QMAKE_VARSUBST_PRE $AFTER $PROFILES $QMAKE_VARSUBST_POST'"
113 unset QMAKESPEC || true
114 ${OE_QMAKE_QMAKE} -makefile -spec ${QMAKESPEC} -o Makefile $QMAKE_VARSUBST_PRE $AFTER $PROFILES $QMAKE_VARSUBST_POST || die "Error calling ${OE_QMAKE_QMAKE} on $PROFILES"
115}
116
117EXPORT_FUNCTIONS do_configure
118
119addtask configure after do_unpack do_patch before do_compile