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