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