Merge branch 'master' of git://repo.or.cz/buildroot
[buildroot.git] / package / qte / qte.mk
blob0921443908ca0ca2e18ec4dc7aefbf97d15c4ba1
1 #############################################################
3 # qte: Qt/E build, includes Qt/E-2, QVfb, and Qtopia-2
5 #############################################################
6 ifeq ($(BR2_QTE_VERSION),)
7 BR2_QTE_VERSION:=FOOBAR1
8 endif
9 ifeq ($(BR2_QTE_QT3_VERSION),)
10 BR2_QTE_QT3_VERSION:=FOOBAR2
11 endif
12 ifeq ($(BR2_QTE_QVFB_VERSION),)
13 BR2_QTE_QVFB_VERSION:=FOOBAR3
14 endif
15 ifeq ($(BR2_QTE_QTOPIA_VERSION),)
16 BR2_QTE_QTOPIA_VERSION:=FOOBAR4
17 endif
18 ifeq ($(BR2_QTE_TMAKE_VERSION),)
19 BR2_QTE_TMAKE_VERSION:=FOOBAR5
20 endif
22 BR2_QTE_C_QTE_VERSION:=$(shell echo $(BR2_QTE_VERSION)| sed -e 's/"//g')
23 BR2_QTE_C_QT3_VERSION:=$(shell echo $(BR2_QTE_QT3_VERSION)| sed -e 's/"//g')
24 BR2_QTE_C_QVFB_VERSION:=$(shell echo $(BR2_QTE_QVFB_VERSION)| sed -e 's/"//g')
25 BR2_QTE_C_QTOPIA_VERSION:=$(shell echo $(BR2_QTE_QTOPIA_VERSION)| sed -e 's/"//g')
26 BR2_QTE_C_TMAKE_VERSION:=$(shell echo $(BR2_QTE_TMAKE_VERSION)| sed -e 's/"//g')
27 BR2_QTE_C_USERNAME:=$(shell echo $(BR2_PACKAGE_QTE_COMMERCIAL_USERNAME)| sed -e 's/"//g')
28 BR2_QTE_C_PASSWORD:=$(shell echo $(BR2_PACKAGE_QTE_COMMERCIAL_PASSWORD)| sed -e 's/"//g')
29 QTE_QTE_SOURCE:=qt-embedded-$(BR2_QTE_C_QTE_VERSION)-commercial.tar.gz
30 QTE_QT3_SOURCE:=qt-$(BR2_QTE_C_QT3_VERSION)-commercial.tar.gz
31 QTE_TMAKE_SOURCE:=tmake-$(BR2_QTE_C_TMAKE_VERSION).tar.gz
32 QTE_QVFB_SOURCE:=qt-x11-$(BR2_QTE_C_QVFB_VERSION)-commercial.tar.gz
33 QTE_QTOPIA_SOURCE:=qtopia-phone-source-$(BR2_QTE_C_QTOPIA_VERSION).tar.gz
34 QTE_SITE:=http://$(BR2_QTE_C_USERNAME):$(BR2_QTE_C_PASSWORD)@dist.trolltech.com/$(BR2_QTE_C_USERNAME)
35 QTE_QTE_DIR:=$(BUILD_DIR)/qt-$(BR2_QTE_C_QTE_VERSION)
36 QTE_QT3_DIR:=$(BUILD_DIR)/qt-$(BR2_QTE_C_QT3_VERSION)
37 QTE_TMAKE_DIR:=$(BUILD_DIR)/tmake-$(BR2_QTE_C_TMAKE_VERSION)
38 QTE_QVFB_DIR:=$(BUILD_DIR)/qt-$(BR2_QTE_C_QVFB_VERSION)
39 QTE_QTOPIA_DIR:=$(BUILD_DIR)/qtopia-phone-$(BR2_QTE_C_QTOPIA_VERSION)
41 QTE_CAT:=$(ZCAT)
42 TMAKE:=$(QTE_TMAKE_DIR)/bin/tmake
43 QTE_UIC_BINARY:=bin/uic
44 QTE_QVFB_BINARY:=bin/qvfb
45 QTE_QTE_LIB:=$(QTE_QTE_DIR)/lib/libqte-mt.so.$(BR2_QTE_C_QTE_VERSION)
46 #QTE_QTE_LIB:=$(TARGET_DIR)/lib/libqte-mt.so.$(BR2_QTE_C_QTE_VERSION)
47 QTE_QTOPIA_FILE:=$(QTE_QTOPIA_DIR)/bin/qpe
48 QTE_QTOPIA_IFILE:=$(QTE_QTOPIA_DIR)/opt/Qtopia/bin/qpe
50 #export QT2DIR=$(pwd)/qt-2.3.2
51 #export QT3DIR=$(pwd)/qt-%{qt_version}
52 #export QTEDIR=$(pwd)/qt-%{qte_version}
53 #export QPEDIR=$(pwd)
55 #############################################################
57 # Calculate configure options... scary eventually, trivial now
59 # currently only tested with threading
60 # FIXME: I should use the staging directory here, but I don't yet.
62 #############################################################
63 # I choose to make the link in libqte so that the linking later is trivial -- a user may choose to use -luuid, or not, and it'll just work.
64 # ...since libqte* needs -luuid anyhow...
65 QTE_QTE_CONFIGURE:=-no-xft -L$(E2FSPROGS_DIR)/lib -luuid
66 QTE_QVFB_CONFIGURE:=-no-xft
67 QTE_QTOPIA_CONFIGURE:=
68 QTE_QT3_CONFIGURE:=
70 ifeq ($(BR2_PTHREADS_NATIVE),y)
71 QTE_QTE_CONFIGURE:=$(QTE_QTE_CONFIGURE) -thread
72 QTE_QVFB_CONFIGURE:=$(QTE_QVFB_CONFIGURE) -thread
73 QTE_QTOPIA_CONFIGURE:=$(QTE_QTOPIA_CONFIGURE) -thread
74 QTE_QT3_CONFIGURE:=$(QTE_QT3_CONFIGURE) -thread
75 endif
77 ifeq ($(BR2_PACKAGE_JPEG),y)
78 QTE_QTE_CONFIGURE:=$(QTE_QTE_CONFIGURE) -system-jpeg
79 #FIXME: Do I need an else on this?
80 endif
82 ifeq ($(BR2_PACKAGE_LIBPNG),y)
83 QTE_QTE_CONFIGURE:=$(QTE_QTE_CONFIGURE) -system-libpng
84 else
85 QTE_QTE_CONFIGURE:=$(QTE_QTE_CONFIGURE) -qt-libpng
86 endif
88 # as of 2005-08-17's snapshot, uClibc's pthread does NOT support pthread_yield, which is needed
89 # for ffmpeg's qtopia-phone-2.1.1/src/3rdparty/plugins/codecs/libffmpeg/mediapacketbuffer.h:230
90 # (also called at line 232). ...so we have to disable ffmpeg
91 QTE_QTOPIA_CONFIGURE:=$(QTE_QTOPIA_CONFIGURE) -without-libffmpeg
93 QTE_QTOPIA_CONFIGURE:=$(QTE_QTOPIA_CONFIGURE) -L $(E2FSPROGS_DIR)/lib -I $(E2FSPROGS_DIR)/lib -luuid
95 #############################################################
97 # Build portion
99 #############################################################
101 ifneq ($(BR2_QTE_C_QTE_VERSION),$(BR2_QTE_C_QT3_VERSION))
102 $(DL_DIR)/$(QTE_QT3_SOURCE):
103 $(WGET) -P $(DL_DIR) $(QTE_SITE)/$(@F)
104 endif
106 $(DL_DIR)/$(QTE_QTE_SOURCE) $(DL_DIR)/$(QTE_QVFB_SOURCE) $(DL_DIR)/$(QTE_QTOPIA_SOURCE):
107 $(WGET) -P $(DL_DIR) $(QTE_SITE)/$(@F)
109 $(QTE_TMAKE_DIR)/.unpacked: $(DL_DIR)/$(QTE_TMAKE_SOURCE)
110 $(QTE_CAT) $(DL_DIR)/$(QTE_TMAKE_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
111 touch $@
113 ifneq ($(BR2_QTE_C_QTE_VERSION),$(BR2_QTE_C_QT3_VERSION))
114 $(QTE_QT3_DIR)/.unpacked: $(DL_DIR)/$(QTE_QT3_SOURCE)
115 $(QTE_CAT) $(DL_DIR)/$(QTE_QT3_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
116 touch $@
117 endif
119 $(QTE_QTE_DIR)/.unpacked: $(DL_DIR)/$(QTE_QTE_SOURCE)
120 $(QTE_CAT) $(DL_DIR)/$(QTE_QTE_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
121 touch $@
123 $(QTE_QVFB_DIR)/.unpacked: $(DL_DIR)/$(QTE_QVFB_SOURCE)
124 $(QTE_CAT) $(DL_DIR)/$(QTE_QVFB_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
125 touch $@
127 $(QTE_QTOPIA_DIR)/.unpacked: $(DL_DIR)/$(QTE_QTOPIA_SOURCE)
128 $(QTE_CAT) $(DL_DIR)/$(QTE_QTOPIA_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
129 # Allow patches -- copy from busybox usage of kernel patcher
130 toolchain/patch-kernel.sh $(@D) package/qte qtopia-$(BR2_QTE_C_QTOPIA_VERSION)-\*.patch
131 touch $@
134 # currently, this assumes that Qtopis is always involved. The dependency fails and the cp is wrong if Qtopis is not selected.
135 # I'll fix that later.
136 $(QTE_QTE_DIR)/.configured: $(QTE_QTE_DIR)/.unpacked $(QTE_TMAKE_DIR)/.unpacked $(QTE_QTE_DIR)/$(QTE_UIC_BINARY) $(QTE_QTE_DIR)/$(QTE_QVFB_BINARY) $(QTE_QTOPIA_DIR)/.unpacked
137 cp $(QTE_QTOPIA_DIR)/src/qt/qconfig-qpe.h $(QTE_QTE_DIR)/src/tools/
138 (cd $(@D); rm -f config.cache; export QTDIR=`pwd`; export TMAKEPATH=$(QTE_TMAKE_DIR)/lib/qws/linux-x86-g++; export PATH=$(STAGING_DIR)/bin:$$QTDIR/bin:$$PATH; export LD_LIBRARY_PATH=$$QTDIR/lib:$$LD_LIBRARY_PATH; echo 'yes' | \
139 $(TARGET_CONFIGURE_ARGS) \
140 $(TARGET_CONFIGURE_OPTS) \
141 ./configure \
142 $(QTE_QTE_CONFIGURE) -qconfig qpe -keypad-mode -qvfb -depths 4,8,16,32 -xplatform $(BR2_QTE_CROSS_PLATFORM) \
144 touch $@
146 ifneq ($(BR2_QTE_C_QTE_VERSION),$(BR2_QTE_C_QT3_VERSION))
147 # this is a host-side build, so we don't use any staging dir stuff, nor any TARGET_CONFIGURE_OPTS
148 $(QTE_QT3_DIR)/.configured: $(QTE_QT3_DIR)/.unpacked $(QTE_TMAKE_DIR)/.unpacked
149 (cd $(@D); rm -f config.cache; export QTDIR=`pwd`; export TMAKEPATH=$(QTE_TMAKE_DIR)/lib/qws/linux-x86-g++; export PATH=$$QTDIR/bin:$$PATH; export LD_LIBRARY_PATH=$$QTDIR/lib:$$LD_LIBRARY_PATH; echo 'yes' | \
150 CC_FOR_BUILD="$(HOSTCC)" \
151 ./configure \
152 -fast $(QTE_QT3_CONFIGURE) \
154 touch $@
155 endif
157 $(QTE_QVFB_DIR)/.configured: $(QTE_QVFB_DIR)/.unpacked $(QTE_TMAKE_DIR)/.unpacked
158 (cd $(@D); rm -f config.cache; export QTDIR=`pwd`; export TMAKEPATH=$(QTE_TMAKE_DIR)/lib/linux-g++; export $$QTDIR/bin:$$PATH; export LD_LIBRARY_PATH=$$QTDIR/lib:$$LD_LIBRARY_PATH; echo 'yes' | \
159 $(TARGET_CONFIGURE_OPTS) \
160 ./configure \
161 $(QTE_QVFB_CONFIGURE) \
163 touch $@
165 # --edition {other}
166 # This has some kooky logic. Qtopia requires a Qt <= 3.3.0 to build, yet we like to use s Qt-2.3.x for size constraints on an embedded device
167 # This target depends on both $(QTE_QTE_DIR)/$(QTE_UIC_BINARY) **and** $(QTE_QT3_DIR)/.configured. if BR2_QTE_C_QTE_VERSION == BR2_QTE_C_QT3_VERSION,
168 # then it really depends on $(QTE_QTE_DIR)/.configured, which $(QTE_QTE_DIR)/$(QTE_UIC_BINARY) needs, so it's redundant. If QTE is 3.3.0 or later,
169 # then BR2_QTE_C_QTE_VERSION != BR2_QTE_C_QT3_VERSION, then we need to unpack the other Qt/E, so this dependency is not redundant.
171 $(QTE_QTOPIA_DIR)/.configured: $(QTE_QTOPIA_DIR)/.unpacked $(QTE_TMAKE_DIR)/.unpacked $(QTE_QTE_DIR)/$(QTE_UIC_BINARY) $(QTE_QTE_DIR)/$(QTE_QVFB_BINARY) $(QTE_QT3_DIR)/.configured
172 (cd $(@D); rm -f config.cache; export QTDIR=$(QTE_QTE_DIR); export QPEDIR=$(QTE_QTOPIA_DIR); export PATH=$(STAGING_DIR)/bin:$$QTDIR/bin:$$PATH; QT3DIR=$(QTE_QTE_DIR); echo 'yes' | \
173 $(TARGET_CONFIGURE_OPTS) \
174 ./configure \
175 $(QTE_QTOPIA_CONFIGURE) --edition phone -no-qtopiadesktop -dqt $(QTE_QT3_DIR) -arch generic -displaysize 160-240 -languages en_US \
176 -platform linux-g++ -qvfb -xplatform $(BR2_QTE_CROSS_PLATFORM) \
178 touch $@
180 # there is no build for tmake, only unpack
181 $(TMAKE): $(QTE_TMAKE_DIR)/.unpacked
183 # This must NOT use TARGET_CC -- it is a host-side tool
184 $(QTE_QVFB_DIR)/.make: $(QTE_QVFB_DIR)/.configured $(TMAKE)
185 #$(TARGET_CONFIGURE_OPTS)
186 export QTDIR=$(QTE_QVFB_DIR); export PATH=$$QTDIR/bin:$$PATH; \
187 $(MAKE) -C $(QTE_QVFB_DIR) src-moc
188 touch $@
190 $(QTE_QTE_DIR)/$(QTE_UIC_BINARY): $(QTE_QVFB_DIR)/.make $(QTE_QTE_DIR)/.unpacked
191 export QTDIR=$(QTE_QVFB_DIR); export PATH=$$QTDIR/bin:$$PATH; \
192 $(MAKE) -C $(QTE_QVFB_DIR)/tools/designer/uic
193 test -d $(@D) || install -dm 0755 $(@D)
194 install -m 0755 $(QTE_QVFB_DIR)/bin/$(@F) $@
196 ifneq ($(BR2_QTE_C_QTE_VERSION),$(BR2_QTE_C_QT3_VERSION))
197 $(QTE_QT3_DIR)/.make: $(QTE_QT3_DIR)/.unpacked
198 ( export QTDIR=$(QTE_QT3_DIR); export PATH=$$QTDIR/bin:$$PATH; export LD_LIBRARY_PATH=$$QTDIR/lib:$$LD_LIBRARY_PATH; \
199 $(MAKE) -C $(QTE_QT3_DIR) sub-src && \
200 $(MAKE) -C $(QTE_QT3_DIR)/tools/linguist/lrelease \
201 $(MAKE) -C $(QTE_QT3_DIR)/tools/linguist/lupdate \
202 $(MAKE) -C $(QTE_QT3_DIR)/tools/designer/uilib \
203 $(MAKE) -C $(QTE_QT3_DIR)/tools/designer/uic
205 touch $@
206 endif
208 $(QTE_QTE_DIR)/$(QTE_QVFB_BINARY): $(QTE_QVFB_DIR)/.make $(QTE_QTE_DIR)/.unpacked $(TMAKE)
209 (cd $(QTE_QVFB_DIR)/tools/qvfb && TMAKEPATH=$(QTE_TMAKE_DIR)/lib/linux-g++ $(TMAKE) -o Makefile qvfb.pro)
210 #$(TARGET_CONFIGURE_OPTS)
211 export QTDIR=$(QTE_QVFB_DIR); export PATH=$$QTDIR/bin:$$PATH; \
212 $(MAKE) -C $(QTE_QVFB_DIR)/tools/qvfb
213 test -d $(@D) || install -dm 0755 $(@D)
214 install -m 0755 $(QTE_QVFB_DIR)/tools/qvfb/$(@F) $@
216 $(QTE_QTE_DIR)/src-mt.mk: $(QTE_QTE_DIR)/.configured
217 # I don't like the src-mk that gets built, so blow it away. Too many includes to override yet
218 echo "SHELL=/bin/sh" > $@
219 echo "" >> $@
220 echo "src-mt:" >> $@
221 echo " cd src; "'$$(MAKE)'" 'QT_THREAD_SUFFIX=-mt' 'QT_LFLAGS_MT="'$$$$(SYSCONF_LFLAGS_THREAD)'" "'$$$$(SYSCONF_LIBS_THREAD)'"' 'QT_CXX_MT="'$$$$(SYSCONF_CXXFLAGS_THREAD)'" -DQT_THREAD_SUPPORT' 'QT_C_MT="'$$$$(SYSCONF_CFLAGS_THREAD)'" -DQT_THREAD_SUPPORT'" >> $@
223 $(QTE_QTE_LIB): $(QTE_QTE_DIR)/src-mt.mk
224 export QTDIR=$(QTE_QTE_DIR); export QPEDIR=$(QTE_QTOPIA_DIR); export PATH=$(STAGING_DIR)/bin:$$QTDIR/bin:$$PATH; \
225 $(MAKE) $(TARGET_CONFIGURE_OPTS) $(TARGET_CC) -C $(QTE_QTE_DIR) src-mt
226 $(MAKE) $(TARGET_CONFIGURE_OPTS) DESTDIR=$(TARGET_DIR)/lib -C $(QTE_QTE_DIR) src-mt
227 # ... and make sure it actually built... grrr... make deep-deep-deep makefile recursion for this habit
228 test -f $@
230 $(QTE_QTOPIA_FILE): $(QTE_QTOPIA_DIR)/.configured
231 export QTDIR=$(QTE_QT3_DIR); export QPEDIR=$(QTE_QTOPIA_DIR); export PATH=$(STAGING_DIR)/bin:$$QTDIR/bin:$$PATH; \
232 $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(QTE_QTOPIA_DIR)
234 $(QTE_QTOPIA_IFILE): $(QTE_QTOPIA_FILE)
235 export QTDIR=$(QTE_QT3_DIR); export QPEDIR=$(QTE_QTOPIA_DIR); export PATH=$(STAGING_DIR)/bin:$$QTDIR/bin:$$PATH; \
236 $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(QTE_QTOPIA_DIR) install PREFIX=$(TARGET_DIR)
239 qte: $(QTE_QTE_LIB)
241 ifeq ($(BR2_PACKAGE_QTE_QTOPIA),y)
242 qte: $(QTE_QTOPIA_IFILE)
243 endif
245 # kinda no-op right now, these are built anyhow
246 ifeq ($(BR2_PACKAGE_QTE_QVFB),y)
247 qte: $(QTE_QTE_DIR)/$(QTE_UIC_BINARY) $(QTE_QTE_DIR)/$(QTE_QVFB_BINARY)
248 endif
250 qte-clean:
251 rm -f $(QTE_QTE_DIR)/$(QTE_UIC_BINARY) $(QTE_QTE_DIR)/$(QTE_QVFB_BINARY) $(QTE_QTE_LIB) $(QTE_QTOPIA_FILE)
252 -$(MAKE) -C $(QTE_QTE_DIR) clean
253 -$(MAKE) -C $(QTE_QVFB_DIR) clean
254 -$(MAKE) -C $(QTE_QTOPIA_DIR) clean
256 qte-dirclean:
257 rm -rf $(QTE_QTE_DIR) $(QTE_QVFB_DIR) $(QTE_QTOPIA_DIR)
258 #############################################################
260 # Toplevel Makefile options
262 #############################################################
263 ifeq ($(BR2_PACKAGE_QTE),y)
264 TARGETS+=qte
265 endif