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