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