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