|
diff --git a/configure b/configure index e81bc95..7db2738 100755 --- a/ configure+++ b/ configure |
|
@@ -1,286 +1,290 @@ |
1 | #!/bin/sh |
1 | #!/bin/sh |
2 | # |
2 | # |
3 | # Configures to build the Qtopia Environment |
3 | # Configures to build the Qtopia Environment |
4 | # |
4 | # |
5 | # Copyright 1999-2000 Trolltech AS. All rights reserved. |
5 | # Copyright 1999-2000 Trolltech AS. All rights reserved. |
6 | # |
6 | # |
7 | |
7 | |
8 | PLATFORM=generic |
8 | PLATFORM=generic |
9 | SHARING=shared |
9 | SHARING=shared |
10 | DEBUG= |
10 | DEBUG= |
11 | QCONFIGARG= |
11 | QCONFIGARG= |
12 | |
12 | |
13 | touch .test.qpe. |
13 | touch .test.qpe. |
14 | if [ '!' -f ${OPIEDIR}/.test.qpe. ]; |
14 | if [ '!' -f ${OPIEDIR}/.test.qpe. ]; |
15 | then |
15 | then |
16 | rm .test.qpe. |
16 | rm .test.qpe. |
17 | echo |
17 | echo |
18 | echo |
18 | echo |
19 | echo ' The environment variable $OPIEDIR is not set correctly. It is currently' |
19 | echo ' The environment variable $OPIEDIR is not set correctly. It is currently' |
20 | echo ' set to "'$OPIEDIR'", but it should be set to this directory,' |
20 | echo ' set to "'$OPIEDIR'", but it should be set to this directory,' |
21 | echo ' which is "'`pwd`'".' |
21 | echo ' which is "'`pwd`'".' |
22 | echo |
22 | echo |
23 | echo ' Please read the INSTALL file for instructions on how to set $OPIEDIR' |
23 | echo ' Please read the INSTALL file for instructions on how to set $OPIEDIR' |
24 | echo ' correctly. If you have set $OPIEDIR in your .profile or .login, you ' |
24 | echo ' correctly. If you have set $OPIEDIR in your .profile or .login, you ' |
25 | echo ' will need to log out and log in again to make the setting effective.' |
25 | echo ' will need to log out and log in again to make the setting effective.' |
26 | echo |
26 | echo |
27 | echo |
27 | echo |
28 | exit 1 |
28 | exit 1 |
29 | fi |
29 | fi |
30 | rm .test.qpe. |
30 | rm .test.qpe. |
31 | |
31 | |
32 | if [ '!' -f $TMAKEPATH/tmake.conf ] |
32 | if [ '!' -f $TMAKEPATH/tmake.conf ] |
33 | then |
33 | then |
34 | # You have tmake. We'll regenerate the file for you... |
34 | # You have tmake. We'll regenerate the file for you... |
35 | echo ' The environment variable $TMAKEPATH is not set correclty. ' |
35 | echo ' The environment variable $TMAKEPATH is not set correclty. ' |
36 | echo ' It should be set to the tmake path' |
36 | echo ' It should be set to the tmake path' |
37 | echo |
37 | echo |
38 | echo ' Please read the INSTALL file for instructions on how to set $TMAKEPATH' |
38 | echo ' Please read the INSTALL file for instructions on how to set $TMAKEPATH' |
39 | echo ' to the environment variable correctly.' |
39 | echo ' to the environment variable correctly.' |
40 | exit 1 |
40 | exit 1 |
41 | fi |
41 | fi |
42 | |
42 | |
43 | VERSION_MAJ=$(sed -n -e 's/.*QPE_VERSION "\([0-9]*\)\.[0-9]*\.[0-9]*.*".*/\1/p' <library/version.h) |
43 | VERSION_MAJ=$(sed -n -e 's/.*QPE_VERSION "\([0-9]*\)\.[0-9]*\.[0-9]*.*".*/\1/p' <library/version.h) |
44 | VERSION_MIN=$(sed -n -e 's/.*QPE_VERSION "[0-9]*\.\([0-9]\)\.[0-9]*.*".*/\1/p' <library/version.h) |
44 | VERSION_MIN=$(sed -n -e 's/.*QPE_VERSION "[0-9]*\.\([0-9]\)\.[0-9]*.*".*/\1/p' <library/version.h) |
45 | VERSION_PAT=$(sed -n -e 's/.*QPE_VERSION "[0-9]*\.[0-9]*\.\([0-9]*\).*".*/\1/p' <library/version.h) |
45 | VERSION_PAT=$(sed -n -e 's/.*QPE_VERSION "[0-9]*\.[0-9]*\.\([0-9]*\).*".*/\1/p' <library/version.h) |
46 | |
46 | |
47 | TOMAKE= |
47 | TOMAKE= |
48 | |
48 | |
49 | if grep -q 'VERSION_STR.*"3' $QTDIR/include/qglobal.h |
49 | if grep -q 'VERSION_STR.*"3' $QTDIR/include/qglobal.h |
50 | then |
50 | then |
51 | QT3=yes |
51 | QT3=yes |
52 | else |
52 | else |
53 | QT3=no |
53 | QT3=no |
54 | fi |
54 | fi |
55 | |
55 | |
56 | # Parse the arguments, setting things to "yes" or "no". |
56 | # Parse the arguments, setting things to "yes" or "no". |
57 | |
57 | |
58 | while [ -n "$1" ]; do |
58 | while [ -n "$1" ]; do |
59 | case $1 in |
59 | case $1 in |
60 | -platform|-xplatform) # No difference since we don't need to build moc, etc. |
60 | -platform|-xplatform) # No difference since we don't need to build moc, etc. |
61 | shift; PLATFORM=$1 |
61 | shift; PLATFORM=$1 |
62 | ;; |
62 | ;; |
63 | -release) |
63 | -release) |
64 | DEBUG= |
64 | DEBUG= |
65 | ;; |
65 | ;; |
66 | -debug) |
66 | -debug) |
67 | DEBUG=-debug |
67 | DEBUG=-debug |
68 | ;; |
68 | ;; |
69 | -shared) |
69 | -shared) |
70 | SHARING=shared |
70 | SHARING=shared |
71 | ;; |
71 | ;; |
72 | -static) |
72 | -static) |
73 | SHARING=static |
73 | SHARING=static |
74 | ;; |
74 | ;; |
75 | -qconfig) |
75 | -qconfig) |
76 | # optional way to specify the qconfig-qpe.h is to pass -qconfig qpe |
76 | # optional way to specify the qconfig-qpe.h is to pass -qconfig qpe |
77 | shift; QCONFIGARG=DEFINES+=QCONFIG='\"'$1'\"' # Don't quote me on that. |
77 | shift; QCONFIGARG=DEFINES+=QCONFIG='\"'$1'\"' # Don't quote me on that. |
78 | ;; |
78 | ;; |
79 | -make) |
79 | -make) |
80 | shift; TOMAKE="$TOMAKE $1" |
80 | shift; TOMAKE="$TOMAKE $1" |
81 | ;; |
81 | ;; |
82 | -qt3) |
82 | -qt3) |
83 | QT3=yes |
83 | QT3=yes |
84 | ;; |
84 | ;; |
85 | *) |
85 | *) |
86 | HELP=yes;; |
86 | HELP=yes;; |
87 | esac |
87 | esac |
88 | shift |
88 | shift |
89 | done |
89 | done |
90 | |
90 | |
91 | TARGET=configs/$PLATFORM-$SHARING$DEBUG |
91 | TARGET=configs/$PLATFORM-$SHARING$DEBUG |
92 | |
92 | |
93 | if [ '!' -f $TARGET ] |
93 | if [ '!' -f $TARGET ] |
94 | then |
94 | then |
95 | if [ -f configs/linux-$PLATFORM-g++-$SHARING$DEBUG ] |
95 | if [ -f configs/linux-$PLATFORM-g++-$SHARING$DEBUG ] |
96 | then |
96 | then |
97 | TARGET=configs/linux-$PLATFORM-g++-$SHARING$DEBUG |
97 | TARGET=configs/linux-$PLATFORM-g++-$SHARING$DEBUG |
98 | else |
98 | else |
99 | echo |
99 | echo |
100 | echo ' The specified platform/compiler not supported: ' $TARGET |
100 | echo ' The specified platform/compiler not supported: ' $TARGET |
101 | echo |
101 | echo |
102 | exit 2 |
102 | exit 2 |
103 | fi |
103 | fi |
104 | fi |
104 | fi |
105 | |
105 | |
106 | # Next, emit a usage message if something failed. |
106 | # Next, emit a usage message if something failed. |
107 | |
107 | |
108 | if [ "$HELP" = "yes" ]; then |
108 | if [ "$HELP" = "yes" ]; then |
109 | cat <<EOF |
109 | cat <<EOF |
110 | Usage: $0 [-debug] [-release] [-shared] [-static] [-qt3] [-platform ...] |
110 | Usage: $0 [-debug] [-release] [-shared] [-static] [-qt3] [-platform ...] |
111 | |
111 | |
112 | The defaults (*) are usually acceptable. Here is a short explanation of |
112 | The defaults (*) are usually acceptable. Here is a short explanation of |
113 | each option: |
113 | each option: |
114 | |
114 | |
115 | * -release ........... Compile and link Qt with debugging turned off. |
115 | * -release ........... Compile and link Qt with debugging turned off. |
116 | -debug ............. Compile and link Qt with debugging turned on. |
116 | -debug ............. Compile and link Qt with debugging turned on. |
117 | |
117 | |
118 | * -shared ............ Create and use a shared Qt library (libqt.so) |
118 | * -shared ............ Create and use a shared Qt library (libqt.so) |
119 | -static ............ Create and use a static Qt library (libqt.a) |
119 | -static ............ Create and use a static Qt library (libqt.a) |
120 | |
120 | |
121 | -qt3 ............... Configure for use with Qt 3.x |
121 | -qt3 ............... Configure for use with Qt 3.x |
122 | |
122 | |
123 | -platform target ... The platform you are building on ($PLATFORM) |
123 | -platform target ... The platform you are building on ($PLATFORM) |
124 | EOF |
124 | EOF |
125 | exit 0; |
125 | exit 0; |
126 | fi |
126 | fi |
127 | |
127 | |
128 | if [ -f library/custom-$PLATFORM.h ] |
128 | if [ -f library/custom-$PLATFORM.h ] |
129 | then |
129 | then |
130 | rm -f library/custom.h |
130 | rm -f library/custom.h |
131 | ln -s custom-$PLATFORM.h library/custom.h |
131 | ln -s custom-$PLATFORM.h library/custom.h |
132 | fi |
132 | fi |
133 | |
133 | |
134 | mkdir -p include/qpe |
134 | mkdir -p include/qpe |
135 | ( cd include/qpe && rm -f *.h; ln -s ../../library/*.h .; ln -s ../../library/backend/*.h .; rm -f *_p.h; ) |
135 | ( cd include/qpe && rm -f *.h; ln -s ../../library/*.h .; ln -s ../../library/backend/*.h .; rm -f *_p.h; ) |
136 | |
136 | |
| |
137 | mkdir -p include/opie |
| |
138 | ( cd include/opie && rm -f *.h; ln -s ../../libopie/*.h .; rm -f *_p.h; ) |
| |
139 | |
| |
140 | |
137 | echo Creating makefiles... |
141 | echo Creating makefiles... |
138 | |
142 | |
139 | sed -e 's/^\(VERSION.*= \).*/\1'$VERSION_MAJ.$VERSION_MIN.$VERSION_PAT/ <library/library.pro >library/library.pro-v |
143 | sed -e 's/^\(VERSION.*= \).*/\1'$VERSION_MAJ.$VERSION_MIN.$VERSION_PAT/ <library/library.pro >library/library.pro-v |
140 | mv library/library.pro-v library/library.pro |
144 | mv library/library.pro-v library/library.pro |
141 | |
145 | |
142 | if [ "$QT3" = yes ] |
146 | if [ "$QT3" = yes ] |
143 | then |
147 | then |
144 | VCONFIG="CONFIG+=qt3" |
148 | VCONFIG="CONFIG+=qt3" |
145 | else |
149 | else |
146 | VCONFIG="CONFIG+=qt2" |
150 | VCONFIG="CONFIG+=qt2" |
147 | fi |
151 | fi |
148 | |
152 | |
149 | if [ -f $TMAKEPATH/tmake.conf ] |
153 | if [ -f $TMAKEPATH/tmake.conf ] |
150 | then |
154 | then |
151 | # You have tmake. We'll regenerate the file for you... |
155 | # You have tmake. We'll regenerate the file for you... |
152 | echo "Makefiles will be regenerated." |
156 | echo "Makefiles will be regenerated." |
153 | fi |
157 | fi |
154 | |
158 | |
155 | H=`pwd` |
159 | H=`pwd` |
156 | if [ -z "$TOMAKE" ] |
160 | if [ -z "$TOMAKE" ] |
157 | then |
161 | then |
158 | TOMAKE=`make showcomponents` |
162 | TOMAKE=`make showcomponents` |
159 | fi |
163 | fi |
160 | |
164 | |
161 | for a in $TOMAKE ; do |
165 | for a in $TOMAKE ; do |
162 | N=$a/Makefile |
166 | N=$a/Makefile |
163 | M=$a/Makefile.in |
167 | M=$a/Makefile.in |
164 | O=$a/Makefile.add |
168 | O=$a/Makefile.add |
165 | f=`basename $a` |
169 | f=`basename $a` |
166 | |
170 | |
167 | if [ -f $TMAKEPATH/tmake.conf -a -f $a/$f.pro ] |
171 | if [ -f $TMAKEPATH/tmake.conf -a -f $a/$f.pro ] |
168 | then |
172 | then |
169 | ( cd $a; |
173 | ( cd $a; |
170 | TMAKEPATH=$QTDIR/tmake:$TMAKEPATH \ |
174 | TMAKEPATH=$QTDIR/tmake:$TMAKEPATH \ |
171 | tmake $QCONFIGARG CONFIG+=embedded $VCONFIG \ |
175 | tmake $QCONFIGARG CONFIG+=embedded $VCONFIG \ |
172 | -t $H/qt/tmake/propagate.t $f.pro | |
176 | -t $H/qt/tmake/propagate.t $f.pro | |
173 | sed -e "s|$QTDIR|\$(QTDIR)|g" -e "s|$OPIEDIR|\$(OPIEDIR)|g" >Makefile.in; |
177 | sed -e "s|$QTDIR|\$(QTDIR)|g" -e "s|$OPIEDIR|\$(OPIEDIR)|g" >Makefile.in; |
174 | ) |
178 | ) |
175 | echo -n "." |
179 | echo -n "." |
176 | appname=`grep '^TARGET' $a/$f.pro | sed 's/^TARGET.*=//' | sed 's/ //g'` |
180 | appname=`grep '^TARGET' $a/$f.pro | sed 's/^TARGET.*=//' | sed 's/ //g'` |
177 | translation=`grep '^TRANSLATION.*[^+]=.*' $a/$f.pro | sed 's,^TRANSL.*=.*i18n\/.*\/,,' | sed 's/ //g' | sed 's,\.ts.*,,' | sed 's,^lib,,' ` |
181 | translation=`grep '^TRANSLATION.*[^+]=.*' $a/$f.pro | sed 's,^TRANSL.*=.*i18n\/.*\/,,' | sed 's/ //g' | sed 's,\.ts.*,,' | sed 's,^lib,,' ` |
178 | if [ -n "$translation" -a -n "$appname" ] |
182 | if [ -n "$translation" -a -n "$appname" ] |
179 | then |
183 | then |
180 | if [ $appname != $translation ] |
184 | if [ $appname != $translation ] |
181 | then |
185 | then |
182 | echo |
186 | echo |
183 | echo "Warning: translation and appname disagree in $a/$f.pro" |
187 | echo "Warning: translation and appname disagree in $a/$f.pro" |
184 | fi |
188 | fi |
185 | fi |
189 | fi |
186 | |
190 | |
187 | fi |
191 | fi |
188 | |
192 | |
189 | cat > $N <<EOF |
193 | cat > $N <<EOF |
190 | ############################################################################# |
194 | ############################################################################# |
191 | # Automatically generated from $M |
195 | # Automatically generated from $M |
192 | # Build options from $1 |
196 | # Build options from $1 |
193 | ############################################################################# |
197 | ############################################################################# |
194 | |
198 | |
195 | EOF |
199 | EOF |
196 | |
200 | |
197 | SED= |
201 | SED= |
198 | PLATFORM_CFLAGS= |
202 | PLATFORM_CFLAGS= |
199 | |
203 | |
200 | if [ "$f" = "embeddedkonsole" ] |
204 | if [ "$f" = "embeddedkonsole" ] |
201 | then |
205 | then |
202 | case $PLATFORM in |
206 | case $PLATFORM in |
203 | *x86*|*generic*|*ipaq*) |
207 | *x86*|*generic*|*ipaq*) |
204 | SED="$SED /^LIBS.*=/s/\$/ -lutil/;" |
208 | SED="$SED /^LIBS.*=/s/\$/ -lutil/;" |
205 | PLATFORM_CFLAGS="-DHAVE_OPENPTY" |
209 | PLATFORM_CFLAGS="-DHAVE_OPENPTY" |
206 | ;; *) |
210 | ;; *) |
207 | SED= |
211 | SED= |
208 | esac |
212 | esac |
209 | elif [ "$f" = "libmpeg3" ] |
213 | elif [ "$f" = "libmpeg3" ] |
210 | then |
214 | then |
211 | # Patch our Makefile.in file with the platform specifics for the libmpeg3 library |
215 | # Patch our Makefile.in file with the platform specifics for the libmpeg3 library |
212 | # Use the C++ compiler to compile the .c files (because the fixed-point classes are C++ code) |
216 | # Use the C++ compiler to compile the .c files (because the fixed-point classes are C++ code) |
213 | SED='s/\$(CC)/\$(CXX)/;' |
217 | SED='s/\$(CC)/\$(CXX)/;' |
214 | case $PLATFORM |
218 | case $PLATFORM |
215 | in |
219 | in |
216 | # For x86 turn on using floating point, compile mmx and css code |
220 | # For x86 turn on using floating point, compile mmx and css code |
217 | *x86*) |
221 | *x86*) |
218 | # "-funroll-loops -fomit-frame-pointer -malign-loops=2 -malign-jumps=2 -malign-functions=2 -march=i486" |
222 | # "-funroll-loops -fomit-frame-pointer -malign-loops=2 -malign-jumps=2 -malign-functions=2 -march=i486" |
219 | PLATFORM_CFLAGS="-DHAVE_MMX -DHAVE_CSS" |
223 | PLATFORM_CFLAGS="-DHAVE_MMX -DHAVE_CSS" |
220 | SED="$SED /SOURCES.*=/s/=/= video\\/mmxidct.S video\\/reconmmx.s\ /;" |
224 | SED="$SED /SOURCES.*=/s/=/= video\\/mmxidct.S video\\/reconmmx.s\ /;" |
221 | # For generic turn on using floating point |
225 | # For generic turn on using floating point |
222 | ;; *generic*) |
226 | ;; *generic*) |
223 | PLATFORM_CFLAGS="" |
227 | PLATFORM_CFLAGS="" |
224 | # For the ipaq use fixed point maths, don't compile the mmx or css code |
228 | # For the ipaq use fixed point maths, don't compile the mmx or css code |
225 | ;; *ipaq*) |
229 | ;; *ipaq*) |
226 | PLATFORM_CFLAGS="-DUSE_FIXED_POINT" |
230 | PLATFORM_CFLAGS="-DUSE_FIXED_POINT" |
227 | ;; *) |
231 | ;; *) |
228 | # For 'other platforms', turn off optimizations and use fixed point |
232 | # For 'other platforms', turn off optimizations and use fixed point |
229 | PLATFORM_CFLAGS="-O -DUSE_FIXED_POINT" |
233 | PLATFORM_CFLAGS="-O -DUSE_FIXED_POINT" |
230 | esac |
234 | esac |
231 | elif [ "$f" = "libmad" ] |
235 | elif [ "$f" = "libmad" ] |
232 | then |
236 | then |
233 | # Patch our Makefile.in file with the platform specifics for the libmad library |
237 | # Patch our Makefile.in file with the platform specifics for the libmad library |
234 | case $PLATFORM |
238 | case $PLATFORM |
235 | in |
239 | in |
236 | # For x86 use intel optimizations |
240 | # For x86 use intel optimizations |
237 | *x86*) |
241 | *x86*) |
238 | PLATFORM_CFLAGS="-DFPM_INTEL" |
242 | PLATFORM_CFLAGS="-DFPM_INTEL" |
239 | # For the ipaq use ARM asm optimizations |
243 | # For the ipaq use ARM asm optimizations |
240 | ;; *ipaq*) |
244 | ;; *ipaq*) |
241 | PLATFORM_CFLAGS="-DFPM_ARM" |
245 | PLATFORM_CFLAGS="-DFPM_ARM" |
242 | SED="$SED /SOURCES.*=/s/=/= idmt_arm.S /;" |
246 | SED="$SED /SOURCES.*=/s/=/= idmt_arm.S /;" |
243 | # For generic platforms use the C 64-bit implementation |
247 | # For generic platforms use the C 64-bit implementation |
244 | ;; *generic*) |
248 | ;; *generic*) |
245 | PLATFORM_CFLAGS="-DFPM_64BIT" |
249 | PLATFORM_CFLAGS="-DFPM_64BIT" |
246 | # For 'other platforms' use the ARM code |
250 | # For 'other platforms' use the ARM code |
247 | ;; *) |
251 | ;; *) |
248 | PLATFORM_CFLAGS="-DFPM_ARM" |
252 | PLATFORM_CFLAGS="-DFPM_ARM" |
249 | SED="$SED /SOURCES.*=/s/=/= idmt_arm.S /;" |
253 | SED="$SED /SOURCES.*=/s/=/= idmt_arm.S /;" |
250 | esac |
254 | esac |
251 | fi |
255 | fi |
252 | if [ -n "$PLATFORM_CFLAGS" ] |
256 | if [ -n "$PLATFORM_CFLAGS" ] |
253 | then |
257 | then |
254 | # Append the addition c-flags we have defined |
258 | # Append the addition c-flags we have defined |
255 | SED="$SED /CFLAGS.*=.*/s/\$/ $PLATFORM_CFLAGS/;" |
259 | SED="$SED /CFLAGS.*=.*/s/\$/ $PLATFORM_CFLAGS/;" |
256 | SED="$SED /CXXFLAGS.*=.*/s/\$/ $PLATFORM_CFLAGS/;" |
260 | SED="$SED /CXXFLAGS.*=.*/s/\$/ $PLATFORM_CFLAGS/;" |
257 | fi |
261 | fi |
258 | cat $TARGET >> $N |
262 | cat $TARGET >> $N |
259 | if [ -n "$SED" ] |
263 | if [ -n "$SED" ] |
260 | then |
264 | then |
261 | sed -e "$SED" $M >> $N |
265 | sed -e "$SED" $M >> $N |
262 | else |
266 | else |
263 | cat $M >> $N |
267 | cat $M >> $N |
264 | fi |
268 | fi |
265 | |
269 | |
266 | cat >> $N <<EOF |
270 | cat >> $N <<EOF |
267 | |
271 | |
268 | lupdate: |
272 | lupdate: |
269 | lupdate $f.pro |
273 | lupdate $f.pro |
270 | |
274 | |
271 | lrelease: |
275 | lrelease: |
272 | lrelease $f.pro |
276 | lrelease $f.pro |
273 | |
277 | |
274 | EOF |
278 | EOF |
275 | if [ -f "$O" ] |
279 | if [ -f "$O" ] |
276 | then |
280 | then |
277 | cat >> $N $O |
281 | cat >> $N $O |
278 | fi |
282 | fi |
279 | |
283 | |
280 | done |
284 | done |
281 | |
285 | |
282 | MAKE=make |
286 | MAKE=make |
283 | echo |
287 | echo |
284 | echo "QPE is now configured for building. Just run $MAKE (or $MAKE single)." |
288 | echo "QPE is now configured for building. Just run $MAKE (or $MAKE single)." |
285 | echo "To reconfigure, run $MAKE clean and configure." |
289 | echo "To reconfigure, run $MAKE clean and configure." |
286 | echo |
290 | echo |
|