1 | #!/bin/sh |
---|
2 | |
---|
3 | ############################## |
---|
4 | ## Configurer for BitlBee ## |
---|
5 | ## ## |
---|
6 | ## Copyright 2004 Lintux ## |
---|
7 | ## Copyright 2002 Lucumo ## |
---|
8 | ############################## |
---|
9 | |
---|
10 | prefix='/usr/local/' |
---|
11 | bindir='$prefix/sbin/' |
---|
12 | etcdir='$prefix/etc/bitlbee/' |
---|
13 | mandir='$prefix/share/man/' |
---|
14 | datadir='$prefix/share/bitlbee/' |
---|
15 | config='/var/lib/bitlbee/' |
---|
16 | plugindir='$prefix/lib/bitlbee/' |
---|
17 | includedir='$prefix/include/bitlbee/' |
---|
18 | libevent='/usr/' |
---|
19 | pidfile='/var/run/bitlbee.pid' |
---|
20 | ipcsocket='/var/run/bitlbee.sock' |
---|
21 | pcdir='$prefix/lib/pkgconfig' |
---|
22 | systemlibdirs="/lib /lib64 /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64" |
---|
23 | |
---|
24 | msn=1 |
---|
25 | jabber=1 |
---|
26 | oscar=1 |
---|
27 | yahoo=1 |
---|
28 | twitter=1 |
---|
29 | |
---|
30 | debug=0 |
---|
31 | strip=1 |
---|
32 | gcov=0 |
---|
33 | plugins=1 |
---|
34 | |
---|
35 | events=glib |
---|
36 | ldap=0 |
---|
37 | ssl=auto |
---|
38 | |
---|
39 | arch=`uname -s` |
---|
40 | cpu=`uname -m` |
---|
41 | |
---|
42 | GLIB_MIN_VERSION=2.4 |
---|
43 | |
---|
44 | echo BitlBee configure |
---|
45 | |
---|
46 | while [ -n "$1" ]; do |
---|
47 | e="`expr "X$1" : 'X--\(.*=.*\)'`" |
---|
48 | if [ -z "$e" ]; then |
---|
49 | cat<<EOF |
---|
50 | |
---|
51 | Usage: $0 [OPTIONS] |
---|
52 | |
---|
53 | Option Description Default |
---|
54 | |
---|
55 | --prefix=... Directories to put files in $prefix |
---|
56 | --bindir=... $bindir |
---|
57 | --etcdir=... $etcdir |
---|
58 | --mandir=... $mandir |
---|
59 | --datadir=... $datadir |
---|
60 | --plugindir=... $plugindir |
---|
61 | --pidfile=... $pidfile |
---|
62 | --config=... $config |
---|
63 | --ipcsocket=... $ipcsocket |
---|
64 | |
---|
65 | --msn=0/1 Disable/enable MSN part $msn |
---|
66 | --jabber=0/1 Disable/enable Jabber part $jabber |
---|
67 | --oscar=0/1 Disable/enable Oscar part (ICQ, AIM) $oscar |
---|
68 | --yahoo=0/1 Disable/enable Yahoo part $yahoo |
---|
69 | --twitter=0/1 Disable/enable Twitter part $twitter |
---|
70 | |
---|
71 | --debug=0/1 Disable/enable debugging $debug |
---|
72 | --strip=0/1 Disable/enable binary stripping $strip |
---|
73 | --gcov=0/1 Disable/enable test coverage reporting $gcov |
---|
74 | --plugins=0/1 Disable/enable plugins support $plugins |
---|
75 | |
---|
76 | --events=... Event handler (glib, libevent) $events |
---|
77 | --ssl=... SSL library to use (gnutls, nss, openssl, bogus, auto) |
---|
78 | $ssl |
---|
79 | |
---|
80 | --target=... Cross compilation target same as host |
---|
81 | EOF |
---|
82 | exit; |
---|
83 | fi |
---|
84 | eval "$e" |
---|
85 | shift; |
---|
86 | done |
---|
87 | |
---|
88 | # Expand $prefix and get rid of double slashes |
---|
89 | bindir=`eval echo "$bindir/" | sed 's/\/\{1,\}/\//g'` |
---|
90 | etcdir=`eval echo "$etcdir/" | sed 's/\/\{1,\}/\//g'` |
---|
91 | mandir=`eval echo "$mandir/" | sed 's/\/\{1,\}/\//g'` |
---|
92 | datadir=`eval echo "$datadir/" | sed 's/\/\{1,\}/\//g'` |
---|
93 | config=`eval echo "$config/" | sed 's/\/\{1,\}/\//g'` |
---|
94 | plugindir=`eval echo "$plugindir/" | sed 's/\/\{1,\}/\//g'` |
---|
95 | includedir=`eval echo "$includedir"/ | sed 's/\/\{1,\}/\//g'` |
---|
96 | libevent=`eval echo "$libevent"/ | sed 's/\/\{1,\}/\//g'` |
---|
97 | |
---|
98 | pidfile=`eval echo "$pidfile" | sed 's/\/\{1,\}/\//g'` |
---|
99 | ipcsocket=`eval echo "$ipcsocket" | sed 's/\/\{1,\}/\//g'` |
---|
100 | pcdir=`eval echo "$pcdir" | sed 's/\/\{1,\}/\//g'` |
---|
101 | |
---|
102 | cat<<EOF>Makefile.settings |
---|
103 | ## BitlBee settings, generated by configure |
---|
104 | PREFIX=$prefix |
---|
105 | BINDIR=$bindir |
---|
106 | ETCDIR=$etcdir |
---|
107 | MANDIR=$mandir |
---|
108 | DATADIR=$datadir |
---|
109 | PLUGINDIR=$plugindir |
---|
110 | CONFIG=$config |
---|
111 | INCLUDEDIR=$includedir |
---|
112 | PCDIR=$pcdir |
---|
113 | |
---|
114 | TARGET=$target |
---|
115 | ARCH=$arch |
---|
116 | CPU=$cpu |
---|
117 | |
---|
118 | DESTDIR= |
---|
119 | LFLAGS= |
---|
120 | EFLAGS= |
---|
121 | EOF |
---|
122 | |
---|
123 | cat<<EOF>config.h |
---|
124 | /* BitlBee settings, generated by configure |
---|
125 | |
---|
126 | Do *NOT* use any of these defines in your code without thinking twice, most |
---|
127 | of them can/will be overridden at run-time */ |
---|
128 | |
---|
129 | #define CONFIG "$config" |
---|
130 | #define ETCDIR "$etcdir" |
---|
131 | #define VARDIR "$datadir" |
---|
132 | #define PLUGINDIR "$plugindir" |
---|
133 | #define PIDFILE "$pidfile" |
---|
134 | #define IPCSOCKET "$ipcsocket" |
---|
135 | #define ARCH "$arch" |
---|
136 | #define CPU "$cpu" |
---|
137 | EOF |
---|
138 | |
---|
139 | |
---|
140 | |
---|
141 | if [ -n "$target" ]; then |
---|
142 | PKG_CONFIG_LIBDIR=/usr/$target/lib/pkgconfig |
---|
143 | export PKG_CONFIG_LIBDIR |
---|
144 | PATH=/usr/$target/bin:$PATH |
---|
145 | CC=$target-cc |
---|
146 | LD=$target-ld |
---|
147 | systemlibdirs="/usr/$target/lib" |
---|
148 | fi |
---|
149 | |
---|
150 | |
---|
151 | if [ "$debug" = "1" ]; then |
---|
152 | [ -z "$CFLAGS" ] && CFLAGS=-g |
---|
153 | echo 'DEBUG=1' >> Makefile.settings |
---|
154 | CFLAGS="$CFLAGS -DDEBUG" |
---|
155 | else |
---|
156 | [ -z "$CFLAGS" ] && CFLAGS="-O2 -fno-strict-aliasing" |
---|
157 | fi |
---|
158 | |
---|
159 | echo CFLAGS=$CFLAGS >> Makefile.settings |
---|
160 | echo CFLAGS+=-I`pwd` -I`pwd`/lib -I`pwd`/protocols -I. >> Makefile.settings |
---|
161 | |
---|
162 | echo CFLAGS+=-DHAVE_CONFIG_H >> Makefile.settings |
---|
163 | |
---|
164 | if [ -n "$CC" ]; then |
---|
165 | CC=$CC |
---|
166 | elif type gcc > /dev/null 2> /dev/null; then |
---|
167 | CC=gcc |
---|
168 | elif type cc > /dev/null 2> /dev/null; then |
---|
169 | CC=cc |
---|
170 | else |
---|
171 | echo 'Cannot find a C compiler, aborting.' |
---|
172 | exit 1; |
---|
173 | fi |
---|
174 | |
---|
175 | echo "CC=$CC" >> Makefile.settings; |
---|
176 | |
---|
177 | if [ -z "$LD" ]; then |
---|
178 | if type ld > /dev/null 2> /dev/null; then |
---|
179 | LD=ld |
---|
180 | else |
---|
181 | echo 'Cannot find ld, aborting.' |
---|
182 | exit 1; |
---|
183 | fi |
---|
184 | fi |
---|
185 | |
---|
186 | echo "LD=$LD" >> Makefile.settings |
---|
187 | |
---|
188 | if [ -z "$PKG_CONFIG" ]; then |
---|
189 | PKG_CONFIG=pkg-config |
---|
190 | fi |
---|
191 | |
---|
192 | if $PKG_CONFIG --version > /dev/null 2>/dev/null && $PKG_CONFIG glib-2.0; then |
---|
193 | if $PKG_CONFIG glib-2.0 --atleast-version=$GLIB_MIN_VERSION; then |
---|
194 | cat<<EOF>>Makefile.settings |
---|
195 | EFLAGS+=`$PKG_CONFIG --libs glib-2.0 gmodule-2.0` |
---|
196 | CFLAGS+=`$PKG_CONFIG --cflags glib-2.0 gmodule-2.0` |
---|
197 | EOF |
---|
198 | else |
---|
199 | echo |
---|
200 | echo 'Found glib2 '`$PKG_CONFIG glib-2.0 --modversion`', but version '$GLIB_MIN_VERSION' or newer is required.' |
---|
201 | exit 1 |
---|
202 | fi |
---|
203 | else |
---|
204 | echo |
---|
205 | echo 'Cannot find glib2 development libraries, aborting. (Install libglib2-dev?)' |
---|
206 | exit 1 |
---|
207 | fi |
---|
208 | |
---|
209 | if [ "$events" = "libevent" ]; then |
---|
210 | if ! [ -f "${libevent}include/event.h" ]; then |
---|
211 | echo |
---|
212 | echo 'Warning: Could not find event.h, you might have to install it and/or specify' |
---|
213 | echo 'its location using the --libevent= argument. (Example: If event.h is in' |
---|
214 | echo '/usr/local/include and binaries are in /usr/local/lib: --libevent=/usr/local)' |
---|
215 | fi |
---|
216 | |
---|
217 | echo '#define EVENTS_LIBEVENT' >> config.h |
---|
218 | cat <<EOF>>Makefile.settings |
---|
219 | EFLAGS+=-levent -L${libevent}lib |
---|
220 | CFLAGS+=-I${libevent}include |
---|
221 | EOF |
---|
222 | elif [ "$events" = "glib" ]; then |
---|
223 | ## We already use glib anyway, so this is all we need (and in fact not even this, but just to be sure...): |
---|
224 | echo '#define EVENTS_GLIB' >> config.h |
---|
225 | else |
---|
226 | echo |
---|
227 | echo 'ERROR: Unknown event handler specified.' |
---|
228 | exit 1 |
---|
229 | fi |
---|
230 | echo 'EVENT_HANDLER=events_'$events'.o' >> Makefile.settings |
---|
231 | |
---|
232 | detect_gnutls() |
---|
233 | { |
---|
234 | if $PKG_CONFIG --exists gnutls; then |
---|
235 | cat <<EOF>>Makefile.settings |
---|
236 | EFLAGS+=`$PKG_CONFIG --libs gnutls` |
---|
237 | CFLAGS+=`$PKG_CONFIG --cflags gnutls` |
---|
238 | EOF |
---|
239 | ssl=gnutls |
---|
240 | ret=1 |
---|
241 | elif libgnutls-config --version > /dev/null 2> /dev/null; then |
---|
242 | cat <<EOF>>Makefile.settings |
---|
243 | EFLAGS+=`libgnutls-config --libs` |
---|
244 | CFLAGS+=`libgnutls-config --cflags` |
---|
245 | EOF |
---|
246 | |
---|
247 | ssl=gnutls |
---|
248 | ret=1; |
---|
249 | else |
---|
250 | ret=0; |
---|
251 | fi; |
---|
252 | } |
---|
253 | |
---|
254 | detect_nss() |
---|
255 | { |
---|
256 | if $PKG_CONFIG --version > /dev/null 2>/dev/null && $PKG_CONFIG mozilla-nss; then |
---|
257 | cat<<EOF>>Makefile.settings |
---|
258 | EFLAGS+=`$PKG_CONFIG --libs mozilla-nss` |
---|
259 | CFLAGS+=`$PKG_CONFIG --cflags mozilla-nss` |
---|
260 | EOF |
---|
261 | |
---|
262 | ssl=nss |
---|
263 | ret=1; |
---|
264 | else |
---|
265 | ret=0; |
---|
266 | fi; |
---|
267 | } |
---|
268 | |
---|
269 | detect_ldap() |
---|
270 | { |
---|
271 | TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX) |
---|
272 | if $CC -o $TMPFILE -shared -lldap 2>/dev/null >/dev/null; then |
---|
273 | cat<<EOF>>Makefile.settings |
---|
274 | EFLAGS+=-lldap |
---|
275 | CFLAGS+= |
---|
276 | EOF |
---|
277 | ldap=1 |
---|
278 | rm -f $TMPFILE |
---|
279 | ret=1 |
---|
280 | else |
---|
281 | ldap=0 |
---|
282 | ret=0 |
---|
283 | fi |
---|
284 | } |
---|
285 | |
---|
286 | RESOLV_TESTCODE=' |
---|
287 | #include <arpa/nameser.h> |
---|
288 | #include <resolv.h> |
---|
289 | |
---|
290 | int main() |
---|
291 | { |
---|
292 | ns_initparse( NULL, 0, NULL ); |
---|
293 | ns_parserr( NULL, ns_s_an, 0, NULL ); |
---|
294 | } |
---|
295 | ' |
---|
296 | |
---|
297 | detect_resolv_dynamic() |
---|
298 | { |
---|
299 | TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX) |
---|
300 | ret=1 |
---|
301 | echo "$RESOLV_TESTCODE" | $CC -o $TMPFILE -x c - -lresolv >/dev/null 2>/dev/null |
---|
302 | if [ "$?" = "0" ]; then |
---|
303 | echo 'EFLAGS+=-lresolv' >> Makefile.settings |
---|
304 | ret=0 |
---|
305 | fi |
---|
306 | |
---|
307 | rm -f $TMPFILE |
---|
308 | return $ret |
---|
309 | } |
---|
310 | |
---|
311 | detect_resolv_static() |
---|
312 | { |
---|
313 | TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX) |
---|
314 | ret=1 |
---|
315 | for i in $systemlibdirs; do |
---|
316 | if [ -f $i/libresolv.a ]; then |
---|
317 | echo "$RESOLV_TESTCODE" | $CC -o $TMPFILE -x c - -Wl,$i/libresolv.a >/dev/null 2>/dev/null |
---|
318 | if [ "$?" = "0" ]; then |
---|
319 | echo 'EFLAGS+='$i'/libresolv.a' >> Makefile.settings |
---|
320 | ret=0 |
---|
321 | fi |
---|
322 | fi |
---|
323 | done |
---|
324 | |
---|
325 | rm -f $TMPFILE |
---|
326 | return $ret |
---|
327 | } |
---|
328 | |
---|
329 | if [ "$ssl" = "auto" ]; then |
---|
330 | detect_gnutls |
---|
331 | if [ "$ret" = "0" ]; then |
---|
332 | detect_nss |
---|
333 | fi |
---|
334 | elif [ "$ssl" = "gnutls" ]; then |
---|
335 | detect_gnutls |
---|
336 | elif [ "$ssl" = "nss" ]; then |
---|
337 | detect_nss |
---|
338 | elif [ "$ssl" = "sspi" ]; then |
---|
339 | echo |
---|
340 | elif [ "$ssl" = "openssl" ]; then |
---|
341 | echo |
---|
342 | echo 'No detection code exists for OpenSSL. Make sure that you have a complete' |
---|
343 | echo 'install of OpenSSL (including devel/header files) before reporting' |
---|
344 | echo 'compilation problems.' |
---|
345 | echo |
---|
346 | echo 'Also, keep in mind that the OpenSSL is, according to some people, not' |
---|
347 | echo 'completely GPL-compatible. Using GnuTLS or NSS is recommended and better' |
---|
348 | echo 'supported by us. However, on many BSD machines, OpenSSL can be considered' |
---|
349 | echo 'part of the operating system, which makes it GPL-compatible.' |
---|
350 | echo |
---|
351 | echo 'For more info, see: http://www.openssl.org/support/faq.html#LEGAL2' |
---|
352 | echo ' http://www.gnome.org/~markmc/openssl-and-the-gpl.html' |
---|
353 | echo |
---|
354 | echo 'Please note that distributing a BitlBee binary which links to OpenSSL is' |
---|
355 | echo 'probably illegal. If you want to create and distribute a binary BitlBee' |
---|
356 | echo 'package, you really should use GnuTLS or NSS instead.' |
---|
357 | echo |
---|
358 | echo 'Also, the OpenSSL license requires us to say this:' |
---|
359 | echo ' * "This product includes software developed by the OpenSSL Project' |
---|
360 | echo ' * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"' |
---|
361 | |
---|
362 | echo 'EFLAGS+=-lssl -lcrypto' >> Makefile.settings |
---|
363 | |
---|
364 | ret=1 |
---|
365 | elif [ "$ssl" = "bogus" ]; then |
---|
366 | echo |
---|
367 | echo 'Using bogus SSL code. This means some features will not work properly.' |
---|
368 | |
---|
369 | ## Yes, you, at the console! How can you authenticate if you don't have any SSL!? |
---|
370 | if [ "$msn" = "1" -o "$yahoo" = "1" ]; then |
---|
371 | echo |
---|
372 | echo 'WARNING: The MSN and Yahoo! modules will not work without SSL. Disabling.' |
---|
373 | msn=0 |
---|
374 | yahoo=0 |
---|
375 | fi |
---|
376 | |
---|
377 | ret=1 |
---|
378 | else |
---|
379 | echo |
---|
380 | echo 'ERROR: Unknown SSL library specified.' |
---|
381 | exit 1 |
---|
382 | fi |
---|
383 | |
---|
384 | if [ "$ret" = "0" ]; then |
---|
385 | echo |
---|
386 | echo 'ERROR: Could not find a suitable SSL library (GnuTLS, libnss or OpenSSL).' |
---|
387 | echo ' Please note that this script doesn'\''t have detection code for OpenSSL,' |
---|
388 | echo ' so if you want to use that, you have to select it by hand. If you don'\''t' |
---|
389 | echo ' need SSL support, you can select the "bogus" SSL library. (--ssl=bogus)' |
---|
390 | |
---|
391 | exit 1 |
---|
392 | fi; |
---|
393 | |
---|
394 | echo 'SSL_CLIENT=ssl_'$ssl'.o' >> Makefile.settings |
---|
395 | |
---|
396 | if detect_resolv_dynamic || detect_resolv_static; then |
---|
397 | echo '#define HAVE_RESOLV_A' >> config.h |
---|
398 | fi |
---|
399 | |
---|
400 | STORAGES="xml" |
---|
401 | |
---|
402 | if [ "$ldap" = "auto" ]; then |
---|
403 | detect_ldap |
---|
404 | fi |
---|
405 | |
---|
406 | if [ "$ldap" = 0 ]; then |
---|
407 | echo "#undef WITH_LDAP" >> config.h |
---|
408 | elif [ "$ldap" = 1 ]; then |
---|
409 | echo |
---|
410 | echo 'LDAP support is a work in progress and does NOT work AT ALL right now.' |
---|
411 | echo |
---|
412 | exit 1 |
---|
413 | |
---|
414 | echo "#define WITH_LDAP 1" >> config.h |
---|
415 | STORAGES="$STORAGES ldap" |
---|
416 | fi |
---|
417 | |
---|
418 | for i in $STORAGES; do |
---|
419 | STORAGE_OBJS="$STORAGE_OBJS storage_$i.o" |
---|
420 | done |
---|
421 | echo "STORAGE_OBJS="$STORAGE_OBJS >> Makefile.settings |
---|
422 | |
---|
423 | if [ "$strip" = 0 ]; then |
---|
424 | echo "STRIP=\# skip strip" >> Makefile.settings; |
---|
425 | else |
---|
426 | if [ "$debug" = 1 ]; then |
---|
427 | echo |
---|
428 | echo 'Stripping binaries does not make sense when debugging. Stripping disabled.' |
---|
429 | echo 'STRIP=\# skip strip' >> Makefile.settings |
---|
430 | strip=0; |
---|
431 | elif [ -n "$STRIP" ]; then |
---|
432 | echo "STRIP=$STRIP" >> Makefile.settings; |
---|
433 | elif type strip > /dev/null 2> /dev/null; then |
---|
434 | echo "STRIP=strip" >> Makefile.settings; |
---|
435 | else |
---|
436 | echo |
---|
437 | echo 'No strip utility found, cannot remove unnecessary parts from executable.' |
---|
438 | echo 'STRIP=\# skip strip' >> Makefile.settings |
---|
439 | strip=0; |
---|
440 | fi; |
---|
441 | fi |
---|
442 | |
---|
443 | if [ "$gcov" = "1" ]; then |
---|
444 | echo "CFLAGS+=--coverage" >> Makefile.settings |
---|
445 | echo "EFLAGS+=--coverage" >> Makefile.settings |
---|
446 | fi |
---|
447 | |
---|
448 | if [ "$plugins" = 0 ]; then |
---|
449 | echo '#undef WITH_PLUGINS' >> config.h |
---|
450 | else |
---|
451 | echo '#define WITH_PLUGINS' >> config.h |
---|
452 | fi |
---|
453 | |
---|
454 | if [ ! -e doc/user-guide/help.txt ] && ! type xmlto > /dev/null 2> /dev/null; then |
---|
455 | echo |
---|
456 | echo 'WARNING: Building from an unreleased source tree without prebuilt helpfile.' |
---|
457 | echo 'Install xmlto if you want online help to work.' |
---|
458 | fi |
---|
459 | |
---|
460 | echo |
---|
461 | if [ -z "$BITLBEE_VERSION" -a -d .bzr ] && type bzr > /dev/null 2> /dev/null; then |
---|
462 | nick=`bzr nick` |
---|
463 | if [ -n "$nick" -a "$nick" != "bitlbee" ]; then |
---|
464 | nick="-$nick" |
---|
465 | else |
---|
466 | nick="" |
---|
467 | fi |
---|
468 | rev=`bzr revno` |
---|
469 | echo 'Using bzr revision #'$rev' as version number' |
---|
470 | BITLBEE_VERSION=\"bzr$nick-$rev\" |
---|
471 | fi |
---|
472 | |
---|
473 | if [ -n "$BITLBEE_VERSION" ]; then |
---|
474 | echo 'Spoofing version number: '$BITLBEE_VERSION |
---|
475 | echo '#undef BITLBEE_VERSION' >> config.h |
---|
476 | echo '#define BITLBEE_VERSION '$BITLBEE_VERSION >> config.h |
---|
477 | echo |
---|
478 | fi |
---|
479 | |
---|
480 | if ! make helloworld > /dev/null 2>&1; then |
---|
481 | echo "WARNING: Your version of make (BSD make?) does not support BitlBee's makefiles." |
---|
482 | echo "BitlBee needs GNU make to build properly. On most systems GNU make is available" |
---|
483 | echo "under the name 'gmake'." |
---|
484 | echo |
---|
485 | if gmake helloworld > /dev/null 2>&1; then |
---|
486 | echo "gmake seems to be available on your machine, great." |
---|
487 | echo |
---|
488 | else |
---|
489 | echo "gmake is not installed (or not working). Please try to install it." |
---|
490 | echo |
---|
491 | fi |
---|
492 | fi |
---|
493 | |
---|
494 | cat <<EOF>bitlbee.pc |
---|
495 | prefix=$prefix |
---|
496 | includedir=$includedir |
---|
497 | |
---|
498 | Name: bitlbee |
---|
499 | Description: IRC to IM gateway |
---|
500 | Requires: glib-2.0 |
---|
501 | Version: $BITLBEE_VERSION |
---|
502 | Libs: |
---|
503 | Cflags: -I\${includedir} |
---|
504 | |
---|
505 | EOF |
---|
506 | |
---|
507 | protocols='' |
---|
508 | protoobjs='' |
---|
509 | |
---|
510 | if [ "$msn" = 0 ]; then |
---|
511 | echo '#undef WITH_MSN' >> config.h |
---|
512 | else |
---|
513 | echo '#define WITH_MSN' >> config.h |
---|
514 | protocols=$protocols'msn ' |
---|
515 | protoobjs=$protoobjs'msn_mod.o ' |
---|
516 | fi |
---|
517 | |
---|
518 | if [ "$jabber" = 0 ]; then |
---|
519 | echo '#undef WITH_JABBER' >> config.h |
---|
520 | else |
---|
521 | echo '#define WITH_JABBER' >> config.h |
---|
522 | protocols=$protocols'jabber ' |
---|
523 | protoobjs=$protoobjs'jabber_mod.o ' |
---|
524 | fi |
---|
525 | |
---|
526 | if [ "$oscar" = 0 ]; then |
---|
527 | echo '#undef WITH_OSCAR' >> config.h |
---|
528 | else |
---|
529 | echo '#define WITH_OSCAR' >> config.h |
---|
530 | protocols=$protocols'oscar ' |
---|
531 | protoobjs=$protoobjs'oscar_mod.o ' |
---|
532 | fi |
---|
533 | |
---|
534 | if [ "$yahoo" = 0 ]; then |
---|
535 | echo '#undef WITH_YAHOO' >> config.h |
---|
536 | else |
---|
537 | echo '#define WITH_YAHOO' >> config.h |
---|
538 | protocols=$protocols'yahoo ' |
---|
539 | protoobjs=$protoobjs'yahoo_mod.o ' |
---|
540 | fi |
---|
541 | |
---|
542 | if [ "$twitter" = 0 ]; then |
---|
543 | echo '#undef WITH_TWITTER' >> config.h |
---|
544 | else |
---|
545 | echo '#define WITH_TWITTER' >> config.h |
---|
546 | protocols=$protocols'twitter ' |
---|
547 | protoobjs=$protoobjs'twitter_mod.o ' |
---|
548 | fi |
---|
549 | |
---|
550 | if [ "$protocols" = "PROTOCOLS = " ]; then |
---|
551 | echo "Warning: You haven't selected any communication protocol to compile!" |
---|
552 | echo " BitlBee will run, but you will be unable to connect to IM servers!" |
---|
553 | fi |
---|
554 | |
---|
555 | echo "PROTOCOLS = $protocols" >> Makefile.settings |
---|
556 | echo "PROTOOBJS = $protoobjs" >> Makefile.settings |
---|
557 | |
---|
558 | echo Architecture: $arch |
---|
559 | case "$arch" in |
---|
560 | Linux ) |
---|
561 | ;; |
---|
562 | GNU/* ) |
---|
563 | ;; |
---|
564 | *BSD ) |
---|
565 | ;; |
---|
566 | Darwin ) |
---|
567 | echo 'STRIP=\# skip strip' >> Makefile.settings |
---|
568 | ;; |
---|
569 | IRIX ) |
---|
570 | ;; |
---|
571 | SunOS ) |
---|
572 | echo 'EFLAGS+=-lresolv -lnsl -lsocket' >> Makefile.settings |
---|
573 | echo 'STRIP=\# skip strip' >> Makefile.settings |
---|
574 | ;; |
---|
575 | AIX ) |
---|
576 | echo 'EFLAGS+=-Wl,-brtl' >> Makefile.settings |
---|
577 | ;; |
---|
578 | CYGWIN* ) |
---|
579 | echo 'Cygwin is not officially supported.' |
---|
580 | ;; |
---|
581 | Windows ) |
---|
582 | ;; |
---|
583 | * ) |
---|
584 | echo 'We haven'\''t tested BitlBee on many platforms yet, yours is untested. YMMV.' |
---|
585 | echo 'Please report any problems at http://bugs.bitlbee.org/.' |
---|
586 | ;; |
---|
587 | esac |
---|
588 | |
---|
589 | if [ -n "$target" ]; then |
---|
590 | echo "Cross-compiling for: $target" |
---|
591 | fi |
---|
592 | |
---|
593 | echo |
---|
594 | echo 'Configuration done:' |
---|
595 | |
---|
596 | if [ "$debug" = "1" ]; then |
---|
597 | echo ' Debugging enabled.' |
---|
598 | else |
---|
599 | echo ' Debugging disabled.' |
---|
600 | fi |
---|
601 | |
---|
602 | if [ "$strip" = "1" ]; then |
---|
603 | echo ' Binary stripping enabled.' |
---|
604 | else |
---|
605 | echo ' Binary stripping disabled.' |
---|
606 | fi |
---|
607 | |
---|
608 | echo ' Using event handler: '$events |
---|
609 | echo ' Using SSL library: '$ssl |
---|
610 | echo ' Building with these storage backends: '$STORAGES |
---|
611 | |
---|
612 | if [ -n "$protocols" ]; then |
---|
613 | echo ' Building with these protocols:' $protocols |
---|
614 | else |
---|
615 | echo ' Building without IM-protocol support. We wish you a lot of fun...' |
---|
616 | fi |
---|