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