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