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/bin/" |
---|
12 | sbindir="$prefix/sbin/" |
---|
13 | etcdir="$prefix/etc/bitlbee/" |
---|
14 | mandir="$prefix/share/man/" |
---|
15 | datadir="$prefix/share/bitlbee/" |
---|
16 | config="/var/lib/bitlbee/" |
---|
17 | libdir="$prefix/lib/" |
---|
18 | plugindir="$prefix/lib/bitlbee/" |
---|
19 | includedir="$prefix/include/bitlbee/" |
---|
20 | systemdsystemunitdir="" |
---|
21 | sysusersdir="" |
---|
22 | libevent="/usr/" |
---|
23 | pidfile="/var/run/bitlbee.pid" |
---|
24 | ipcsocket="" |
---|
25 | pcdir="$prefix/lib/pkgconfig" |
---|
26 | systemlibdirs="/lib64 /usr/lib64 /usr/local/lib64 /lib /usr/lib /usr/local/lib" |
---|
27 | sysroot="" |
---|
28 | |
---|
29 | configure_args="$*" |
---|
30 | |
---|
31 | # Set these to default-on to let it be overriden by either the user or purple |
---|
32 | # |
---|
33 | # If the user sets one of these to 1, purple won't disable them. |
---|
34 | # Otherwise, if it's still default-on, it gets included in normal builds, |
---|
35 | # but not purple ones. |
---|
36 | jabber="default-on" |
---|
37 | |
---|
38 | twitter=1 |
---|
39 | purple=0 |
---|
40 | |
---|
41 | verbose=0 |
---|
42 | doc=1 |
---|
43 | debug=0 |
---|
44 | strip=0 |
---|
45 | gcov=0 |
---|
46 | asan=0 |
---|
47 | plugins=1 |
---|
48 | otr=0 |
---|
49 | |
---|
50 | events=glib |
---|
51 | external_json_parser=auto |
---|
52 | ssl=auto |
---|
53 | |
---|
54 | pam=0 |
---|
55 | ldap=0 |
---|
56 | |
---|
57 | pie=1 |
---|
58 | |
---|
59 | systemd=auto |
---|
60 | |
---|
61 | arch=$(uname -s) |
---|
62 | arch_rel=$(uname -r) |
---|
63 | |
---|
64 | GLIB_MIN_VERSION=2.32 |
---|
65 | |
---|
66 | # Cygwin, Darwin and SunOS < 5.11 do not support PIC/PIE |
---|
67 | case "$arch" in |
---|
68 | CYGWIN* ) |
---|
69 | pie=0;; |
---|
70 | Darwin ) |
---|
71 | pie=0;; |
---|
72 | SunOS ) |
---|
73 | if [ "$arch_rel" = "5.10" ]; then |
---|
74 | pie=0 |
---|
75 | fi |
---|
76 | ;; |
---|
77 | esac |
---|
78 | |
---|
79 | get_version() { |
---|
80 | REAL_BITLBEE_VERSION=$(grep '^#define BITLBEE_VERSION ' "$srcdir"/bitlbee.h | sed 's/.*\"\(.*\)\".*/\1/') |
---|
81 | |
---|
82 | if [ -n "$BITLBEE_VERSION" ]; then |
---|
83 | # environment variable already set to something to spoof it |
---|
84 | # don't replace it with the git stuff |
---|
85 | return |
---|
86 | fi |
---|
87 | |
---|
88 | BITLBEE_VERSION=$REAL_BITLBEE_VERSION |
---|
89 | |
---|
90 | if [ -d "$srcdir"/.git ] && type git > /dev/null 2> /dev/null; then |
---|
91 | timestamp=$(cd "$srcdir" || exit 1; git show -s --format=%ci HEAD | sed 's/ .*$//; s/-//g') |
---|
92 | branch=$(cd "$srcdir" || exit 1; git rev-parse --abbrev-ref HEAD) |
---|
93 | |
---|
94 | search='\(.*\)-\([0-9]*\)-\(g[0-9a-f]*\)' |
---|
95 | replace="\1+$timestamp+$branch+\2-\3-git" |
---|
96 | |
---|
97 | if ! describe=$(cd "$srcdir" || exit 1; git describe --long --tags 2>/dev/null) ; then |
---|
98 | describe=${REAL_BITLBEE_VERSION}-0-g$(cd "$srcdir" || exit; git rev-parse --short HEAD) |
---|
99 | fi |
---|
100 | |
---|
101 | BITLBEE_VERSION=$(echo "$describe" | sed "s#$search#$replace#") |
---|
102 | |
---|
103 | unset timestamp branch search replace describe |
---|
104 | fi |
---|
105 | } |
---|
106 | |
---|
107 | if [ "$1" = "--dump-version" ]; then |
---|
108 | srcdir=$(cd "$(dirname "$0")" || exit;pwd) |
---|
109 | get_version |
---|
110 | echo "$BITLBEE_VERSION" |
---|
111 | exit |
---|
112 | fi |
---|
113 | |
---|
114 | echo BitlBee configure |
---|
115 | |
---|
116 | while [ -n "$1" ]; do |
---|
117 | e="$(expr "X$1" : 'X--\(.*=.*\)')" |
---|
118 | if [ -z "$e" ]; then |
---|
119 | cat<<EOF |
---|
120 | |
---|
121 | Usage: $0 [OPTIONS] |
---|
122 | |
---|
123 | Option Description Default |
---|
124 | |
---|
125 | --prefix=... Directories to put files in $prefix |
---|
126 | --bindir=... $bindir |
---|
127 | --sbindir=... $sbindir |
---|
128 | --etcdir=... $etcdir |
---|
129 | --mandir=... $mandir |
---|
130 | --datadir=... $datadir |
---|
131 | --plugindir=... $plugindir |
---|
132 | --systemdsystemunitdir=... $systemdsystemunitdir |
---|
133 | --sysusersdir $sysusersdir |
---|
134 | --pidfile=... $pidfile |
---|
135 | --config=... $config |
---|
136 | |
---|
137 | --verbose=0/1 Disable/enable verbose build $verbose |
---|
138 | |
---|
139 | --jabber=0/1 Disable/enable Jabber part $jabber |
---|
140 | --twitter=0/1 Disable/enable Twitter part $twitter |
---|
141 | |
---|
142 | --purple=0/1 Disable/enable libpurple support $purple |
---|
143 | (automatically disables other protocol modules) |
---|
144 | |
---|
145 | --pam=0/1 Disable/enable PAM authentication $pam |
---|
146 | --ldap=0/1 Disable/enable LDAP authentication $ldap |
---|
147 | |
---|
148 | --doc=0/1 Disable/enable help.txt generation $doc |
---|
149 | --debug=0/1 Disable/enable debugging $debug |
---|
150 | --strip=0/1 Disable/enable binary stripping $strip |
---|
151 | --pie=0/1 Build position independent executable $pie |
---|
152 | --gcov=0/1 Disable/enable test coverage reporting $gcov |
---|
153 | --asan=0/1 Disable/enable AddressSanitizer $asan |
---|
154 | --plugins=0/1 Disable/enable plugins support $plugins |
---|
155 | --otr=0/1/auto/plugin |
---|
156 | Disable/enable OTR encryption support $otr |
---|
157 | |
---|
158 | --events=... Event handler (glib, libevent) $events |
---|
159 | --ssl=... SSL library to use (gnutls, nss, openssl, auto) |
---|
160 | $ssl |
---|
161 | --external_json_parser=0/1/auto Use External JSON parser $external_json_parser |
---|
162 | --systemd=0/1 Enable/disable systemd support $systemd |
---|
163 | |
---|
164 | |
---|
165 | --target=... Cross compilation target same as host |
---|
166 | --sysroot=... Cross compilation sysroot $sysroot |
---|
167 | EOF |
---|
168 | exit; |
---|
169 | fi |
---|
170 | eval "$e" |
---|
171 | shift; |
---|
172 | done |
---|
173 | |
---|
174 | # Expand $prefix and get rid of double slashes |
---|
175 | bindir=$(eval echo "$bindir/" | sed 's/\/\{1,\}/\//g') |
---|
176 | sbindir=$(eval echo "$sbindir/" | sed 's/\/\{1,\}/\//g') |
---|
177 | etcdir=$(eval echo "$etcdir/" | sed 's/\/\{1,\}/\//g') |
---|
178 | mandir=$(eval echo "$mandir/" | sed 's/\/\{1,\}/\//g') |
---|
179 | datadir=$(eval echo "$datadir/" | sed 's/\/\{1,\}/\//g') |
---|
180 | config=$(eval echo "$config/" | sed 's/\/\{1,\}/\//g') |
---|
181 | libdir=$(eval echo "$libdir/" | sed 's/\/\{1,\}/\//g') |
---|
182 | plugindir=$(eval echo "$plugindir/" | sed 's/\/\{1,\}/\//g') |
---|
183 | includedir=$(eval echo "$includedir"/ | sed 's/\/\{1,\}/\//g') |
---|
184 | libevent=$(eval echo "$libevent"/ | sed 's/\/\{1,\}/\//g') |
---|
185 | |
---|
186 | pidfile=$(eval echo "$pidfile" | sed 's/\/\{1,\}/\//g') |
---|
187 | ipcsocket=$(eval echo "$ipcsocket" | sed 's/\/\{1,\}/\//g') |
---|
188 | pcdir=$(eval echo "$pcdir" | sed 's/\/\{1,\}/\//g') |
---|
189 | |
---|
190 | protocols_mods="" |
---|
191 | |
---|
192 | cat <<EOF >Makefile.settings |
---|
193 | ## BitlBee settings, generated by configure |
---|
194 | |
---|
195 | # ./configure $configure_args |
---|
196 | |
---|
197 | PREFIX=$prefix |
---|
198 | BINDIR=$bindir |
---|
199 | SBINDIR=$sbindir |
---|
200 | ETCDIR=$etcdir |
---|
201 | MANDIR=$mandir |
---|
202 | DATADIR=$datadir |
---|
203 | PLUGINDIR=$plugindir |
---|
204 | CONFIG=$config |
---|
205 | LIBDIR=$libdir |
---|
206 | INCLUDEDIR=$includedir |
---|
207 | PCDIR=$pcdir |
---|
208 | |
---|
209 | TARGET=$target |
---|
210 | |
---|
211 | INSTALL=install -p |
---|
212 | |
---|
213 | DESTDIR= |
---|
214 | LFLAGS= |
---|
215 | EFLAGS=-lm |
---|
216 | EOF |
---|
217 | |
---|
218 | srcdir=$(cd "$(dirname "$0")" || exit;pwd) |
---|
219 | currdir=$(pwd) |
---|
220 | if [ ! "$srcdir" = "$currdir" ]; then |
---|
221 | echo |
---|
222 | echo "configure script run from a different directory. Will create some symlinks..." |
---|
223 | if [ ! -e Makefile ] || [ -L Makefile ]; then |
---|
224 | COPYDIRS="doc lib protocols tests utils" |
---|
225 | mkdir -p "$(cd "$srcdir" || exit 1; find "$COPYDIRS" -type d)" |
---|
226 | find . -name Makefile -type l -print0 | xargs -0 rm 2> /dev/null |
---|
227 | dst="$PWD" |
---|
228 | cd "$srcdir" || exit 1 |
---|
229 | find . -type f -name Makefile -print | while read -r i ; do |
---|
230 | ln -s "$PWD${i#.}" "$dst/$i"; |
---|
231 | done |
---|
232 | cd "$dst" || exit 1 |
---|
233 | rm -rf .bzr |
---|
234 | fi |
---|
235 | |
---|
236 | echo "_SRCDIR_=$srcdir/" >> Makefile.settings |
---|
237 | CFLAGS="$CFLAGS -I${dst}" |
---|
238 | else |
---|
239 | srcdir=$PWD |
---|
240 | fi |
---|
241 | |
---|
242 | cat<<EOF >config.h |
---|
243 | /* BitlBee settings, generated by configure |
---|
244 | |
---|
245 | Do *NOT* use any of these defines in your code without thinking twice, most |
---|
246 | of them can/will be overridden at run-time */ |
---|
247 | |
---|
248 | #define BITLBEE_CONFIGURE_ARGS "$configure_args" |
---|
249 | |
---|
250 | #define CONFIG "$config" |
---|
251 | #define ETCDIR "$etcdir" |
---|
252 | #define VARDIR "$datadir" |
---|
253 | #define PLUGINDIR "$plugindir" |
---|
254 | #define DATADIR "$datadir" |
---|
255 | #define PIDFILE "$pidfile" |
---|
256 | #define IPCSOCKET "$ipcsocket" |
---|
257 | EOF |
---|
258 | |
---|
259 | |
---|
260 | |
---|
261 | if [ -n "$target" ]; then |
---|
262 | # prepend sysroot to system lib dirs |
---|
263 | |
---|
264 | systemlibdirs_cross='' |
---|
265 | for i in $systemlibdirs; do |
---|
266 | systemlibdirs_cross="$systemlibdirs_cross $sysroot$i" |
---|
267 | done |
---|
268 | systemlibdirs=$systemlibdirs_cross |
---|
269 | unset systemlibdirs_cross |
---|
270 | |
---|
271 | # backward compatibility |
---|
272 | |
---|
273 | if [ -z "$PKG_CONFIG_LIBDIR" ]; then |
---|
274 | PKG_CONFIG_LIBDIR=/usr/"$target"/lib/pkgconfig |
---|
275 | export PKG_CONFIG_LIBDIR |
---|
276 | fi |
---|
277 | |
---|
278 | if [ -d /usr/"$target"/bin ]; then |
---|
279 | PATH=/usr/"$target"/bin:$PATH |
---|
280 | fi |
---|
281 | |
---|
282 | if [ -d /usr/"$target"/lib ]; then |
---|
283 | systemlibdirs="$systemlibdirs /usr/$target/lib" |
---|
284 | fi |
---|
285 | |
---|
286 | CC=$target-cc |
---|
287 | LD=$target-ld |
---|
288 | STRIP=$target-strip |
---|
289 | fi |
---|
290 | |
---|
291 | if [ "$asan" = "1" ]; then |
---|
292 | CFLAGS="$CFLAGS -fsanitize=address" |
---|
293 | LDFLAGS="$LDFLAGS -fsanitize=address" |
---|
294 | debug=1 |
---|
295 | fi |
---|
296 | |
---|
297 | if [ "$verbose" = "0" ]; then |
---|
298 | echo 'VERBOSE=@' >> Makefile.settings |
---|
299 | else |
---|
300 | echo 'VERBOSE=' >> Makefile.settings |
---|
301 | fi |
---|
302 | |
---|
303 | cat <<EOF >>Makefile.settings |
---|
304 | |
---|
305 | # Enable/disable output verbosity |
---|
306 | ifdef V |
---|
307 | ifeq (\$(V),1) |
---|
308 | VERBOSE= |
---|
309 | else |
---|
310 | VERBOSE=@ |
---|
311 | endif |
---|
312 | endif |
---|
313 | |
---|
314 | EOF |
---|
315 | |
---|
316 | if [ "$debug" = "1" ]; then |
---|
317 | echo 'DEBUG=1' >> Makefile.settings |
---|
318 | CFLAGS="$CFLAGS -g3 -DDEBUG -O0" |
---|
319 | else |
---|
320 | [ -z "$CFLAGS" ] && CFLAGS="-g -O2" |
---|
321 | fi |
---|
322 | |
---|
323 | if [ "$pie" = "1" ]; then |
---|
324 | echo 'CFLAGS_BITLBEE=-fPIE' >> Makefile.settings |
---|
325 | echo 'LDFLAGS_BITLBEE=-pie' >> Makefile.settings |
---|
326 | fi |
---|
327 | |
---|
328 | # shellcheck disable=SC2129 |
---|
329 | echo "LDFLAGS=$LDFLAGS" >> Makefile.settings |
---|
330 | |
---|
331 | echo "CFLAGS=$CFLAGS $CPPFLAGS" >> Makefile.settings |
---|
332 | echo CFLAGS+=-I"${srcdir}" -I"${srcdir}"/lib -I"${srcdir}"/protocols -I. >> Makefile.settings |
---|
333 | |
---|
334 | echo CFLAGS+=-DHAVE_CONFIG_H -D_GNU_SOURCE >> Makefile.settings |
---|
335 | |
---|
336 | if type gcc > /dev/null 2> /dev/null; then |
---|
337 | CC=gcc |
---|
338 | elif type cc > /dev/null 2> /dev/null; then |
---|
339 | CC=cc |
---|
340 | else |
---|
341 | echo 'Cannot find a C compiler, aborting.' |
---|
342 | exit 1; |
---|
343 | fi |
---|
344 | |
---|
345 | echo "CC=$CC" >> Makefile.settings; |
---|
346 | if echo $CC | grep -qw 'gcc\|clang'; then |
---|
347 | # Apparently -Wall is gcc-specific? |
---|
348 | echo CFLAGS+=-Wall -Wformat -Werror=format-security >> Makefile.settings |
---|
349 | fi |
---|
350 | |
---|
351 | if [ -z "$LD" ]; then |
---|
352 | if type ld > /dev/null 2> /dev/null; then |
---|
353 | LD=ld |
---|
354 | else |
---|
355 | echo 'Cannot find ld, aborting.' |
---|
356 | exit 1; |
---|
357 | fi |
---|
358 | fi |
---|
359 | |
---|
360 | echo "LD=$LD" >> Makefile.settings |
---|
361 | |
---|
362 | if [ -z "$PKG_CONFIG" ]; then |
---|
363 | PKG_CONFIG=pkg-config |
---|
364 | fi |
---|
365 | |
---|
366 | if ! $PKG_CONFIG --version > /dev/null 2>/dev/null; then |
---|
367 | echo |
---|
368 | echo 'Cannot find pkg-config, aborting.' |
---|
369 | exit 1 |
---|
370 | fi |
---|
371 | |
---|
372 | if $PKG_CONFIG glib-2.0; then |
---|
373 | if $PKG_CONFIG glib-2.0 --atleast-version=$GLIB_MIN_VERSION; then |
---|
374 | cat<<EOF >>Makefile.settings |
---|
375 | EFLAGS+=$($PKG_CONFIG --libs glib-2.0 gmodule-2.0) |
---|
376 | CFLAGS+=$($PKG_CONFIG --cflags glib-2.0 gmodule-2.0) |
---|
377 | EOF |
---|
378 | else |
---|
379 | echo |
---|
380 | echo "Found glib2 $($PKG_CONFIG glib-2.0 --modversion), but version $GLIB_MIN_VERSION or newer is required." |
---|
381 | exit 1 |
---|
382 | fi |
---|
383 | else |
---|
384 | echo |
---|
385 | echo 'Cannot find glib2 development libraries, aborting. (Install libglib2-dev?)' |
---|
386 | exit 1 |
---|
387 | fi |
---|
388 | |
---|
389 | if [ "$events" = "libevent" ]; then |
---|
390 | if ! [ -f "${libevent}include/event.h" ]; then |
---|
391 | echo |
---|
392 | echo 'Warning: Could not find event.h, you might have to install it and/or specify' |
---|
393 | echo 'its location using the --libevent= argument. (Example: If event.h is in' |
---|
394 | echo '/usr/local/include and binaries are in /usr/local/lib: --libevent=/usr/local)' |
---|
395 | fi |
---|
396 | |
---|
397 | echo '#define EVENTS_LIBEVENT' >> config.h |
---|
398 | cat <<EOF >>Makefile.settings |
---|
399 | EFLAGS+=-levent -L${libevent}lib |
---|
400 | CFLAGS+=-I${libevent}include |
---|
401 | EOF |
---|
402 | elif [ "$events" = "glib" ]; then |
---|
403 | ## We already use glib anyway, so this is all we need (and in fact not even this, but just to be sure...): |
---|
404 | echo '#define EVENTS_GLIB' >> config.h |
---|
405 | else |
---|
406 | echo |
---|
407 | echo 'ERROR: Unknown event handler specified.' |
---|
408 | exit 1 |
---|
409 | fi |
---|
410 | echo 'EVENT_HANDLER=events_'$events'.o' >> Makefile.settings |
---|
411 | |
---|
412 | if [ "$external_json_parser" = "auto" ]; then |
---|
413 | if pkg-config --exists json-parser; then |
---|
414 | external_json_parser=1 |
---|
415 | else |
---|
416 | external_json_parser=0 |
---|
417 | fi |
---|
418 | fi |
---|
419 | echo "EXTERNAL_JSON_PARSER=$external_json_parser" >> Makefile.settings |
---|
420 | if [ "$external_json_parser" = "1" ]; then |
---|
421 | # shellcheck disable=SC2129 |
---|
422 | echo "CFLAGS+=$(pkg-config --cflags json-parser)" >> Makefile.settings |
---|
423 | echo "LDFLAGS_BITLBEE+=$(pkg-config --libs json-parser)" >> Makefile.settings |
---|
424 | echo "LDFLAGS_TESTS+=$(pkg-config --libs json-parser)" >> Makefile.settings |
---|
425 | fi |
---|
426 | |
---|
427 | |
---|
428 | detect_gnutls() |
---|
429 | { |
---|
430 | if $PKG_CONFIG --exists gnutls; then |
---|
431 | cat <<EOF >>Makefile.settings |
---|
432 | EFLAGS+=$($PKG_CONFIG --libs gnutls) $(libgcrypt-config --libs) |
---|
433 | CFLAGS+=$($PKG_CONFIG --cflags gnutls) $(libgcrypt-config --cflags) |
---|
434 | EOF |
---|
435 | ssl=gnutls |
---|
436 | if ! $PKG_CONFIG gnutls --atleast-version=2.8; then |
---|
437 | echo |
---|
438 | echo 'Warning: With GnuTLS versions <2.8, certificate expire dates are not verified.' |
---|
439 | fi |
---|
440 | ret=1 |
---|
441 | elif libgnutls-config --version > /dev/null 2> /dev/null; then |
---|
442 | cat <<EOF >>Makefile.settings |
---|
443 | EFLAGS+=$(libgnutls-config --libs) $(libgcrypt-config --libs) |
---|
444 | CFLAGS+=$(libgnutls-config --cflags) $(libgcrypt-config --cflags) |
---|
445 | EOF |
---|
446 | |
---|
447 | ssl=gnutls |
---|
448 | ret=1; |
---|
449 | else |
---|
450 | ret=0; |
---|
451 | fi; |
---|
452 | } |
---|
453 | |
---|
454 | detect_nss() |
---|
455 | { |
---|
456 | if $PKG_CONFIG --version > /dev/null 2>/dev/null && $PKG_CONFIG nss; then |
---|
457 | cat<<EOF >>Makefile.settings |
---|
458 | EFLAGS+=$($PKG_CONFIG --libs nss) |
---|
459 | CFLAGS+=$($PKG_CONFIG --cflags nss) |
---|
460 | EOF |
---|
461 | |
---|
462 | ssl=nss |
---|
463 | ret=1; |
---|
464 | else |
---|
465 | ret=0; |
---|
466 | fi; |
---|
467 | } |
---|
468 | |
---|
469 | RESOLV_TESTCODE=' |
---|
470 | #include <sys/types.h> |
---|
471 | #include <netinet/in.h> |
---|
472 | #include <arpa/nameser.h> |
---|
473 | #include <resolv.h> |
---|
474 | |
---|
475 | int main() |
---|
476 | { |
---|
477 | |
---|
478 | res_query( NULL, 0, 0, NULL, 0); |
---|
479 | dn_expand( NULL, NULL, NULL, NULL, 0); |
---|
480 | dn_skipname( NULL, NULL); |
---|
481 | } |
---|
482 | ' |
---|
483 | RESOLV_NS_TESTCODE=' |
---|
484 | #include <sys/types.h> |
---|
485 | #include <netinet/in.h> |
---|
486 | #include <arpa/nameser.h> |
---|
487 | #include <resolv.h> |
---|
488 | |
---|
489 | int main() |
---|
490 | { |
---|
491 | ns_initparse( NULL, 0, NULL ); |
---|
492 | ns_parserr( NULL, ns_s_an, 0, NULL ); |
---|
493 | } |
---|
494 | ' |
---|
495 | RESOLV_NS_TYPES_TESTCODE=' |
---|
496 | #include <sys/types.h> |
---|
497 | #include <netinet/in.h> |
---|
498 | #include <arpa/nameser.h> |
---|
499 | |
---|
500 | int main() |
---|
501 | { |
---|
502 | ns_msg nsh; |
---|
503 | ns_rr rr; |
---|
504 | |
---|
505 | /* Not all platforms we want to work on have |
---|
506 | ns_* routines, so use this to make sure |
---|
507 | the compiler uses it.*/ |
---|
508 | return (int)(sizeof(nsh) + sizeof(rr)); |
---|
509 | } |
---|
510 | ' |
---|
511 | |
---|
512 | BACKTRACE_TESTCODE=' |
---|
513 | #include <execinfo.h> |
---|
514 | |
---|
515 | int main() |
---|
516 | { |
---|
517 | void *trace[16]; |
---|
518 | return backtrace(trace, 16); |
---|
519 | } |
---|
520 | ' |
---|
521 | |
---|
522 | detect_resolv_dynamic() |
---|
523 | { |
---|
524 | case "$arch" in |
---|
525 | OpenBSD ) |
---|
526 | # In FreeBSD res_*/dn_* routines are present in libc.so |
---|
527 | LIBRESOLV=;; |
---|
528 | FreeBSD ) |
---|
529 | # In FreeBSD res_*/dn_* routines are present in libc.so |
---|
530 | LIBRESOLV=;; |
---|
531 | CYGWIN* ) |
---|
532 | # In Cygwin res_*/dn_* routines are present in libc.so |
---|
533 | LIBRESOLV=;; |
---|
534 | * ) |
---|
535 | LIBRESOLV=-lresolv;; |
---|
536 | esac |
---|
537 | TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX) |
---|
538 | ret=1 |
---|
539 | if echo "$RESOLV_TESTCODE" | $CC -o "$TMPFILE" -x c - $LIBRESOLV >/dev/null 2>/dev/null ; then |
---|
540 | echo "EFLAGS+=$LIBRESOLV" >> Makefile.settings |
---|
541 | ret=0 |
---|
542 | fi |
---|
543 | |
---|
544 | rm -f "$TMPFILE" |
---|
545 | return $ret |
---|
546 | } |
---|
547 | |
---|
548 | detect_resolv_static() |
---|
549 | { |
---|
550 | TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX) |
---|
551 | ret=1 |
---|
552 | for i in $systemlibdirs; do |
---|
553 | if [ -f "$i"/libresolv.a ]; then |
---|
554 | if echo "$RESOLV_TESTCODE" | $CC -o "$TMPFILE" -x c - -Wl,"$i"/libresolv.a >/dev/null 2>/dev/null ; then |
---|
555 | echo "EFLAGS+=$i/libresolv.a" >> Makefile.settings |
---|
556 | ret=0 |
---|
557 | fi |
---|
558 | fi |
---|
559 | done |
---|
560 | |
---|
561 | rm -f "$TMPFILE" |
---|
562 | return $ret |
---|
563 | } |
---|
564 | |
---|
565 | detect_resolv_ns_dynamic() |
---|
566 | { |
---|
567 | case "$arch" in |
---|
568 | FreeBSD ) |
---|
569 | # In FreeBSD ns_ routines are present in libc.so |
---|
570 | LIBRESOLV=;; |
---|
571 | * ) |
---|
572 | LIBRESOLV=-lresolv;; |
---|
573 | esac |
---|
574 | TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX) |
---|
575 | ret=1 |
---|
576 | if echo "$RESOLV_NS_TESTCODE" | $CC -o "$TMPFILE" -x c - $LIBRESOLV >/dev/null 2>/dev/null ; then |
---|
577 | ret=0 |
---|
578 | fi |
---|
579 | |
---|
580 | rm -f "$TMPFILE" |
---|
581 | return $ret |
---|
582 | } |
---|
583 | |
---|
584 | detect_resolv_ns_static() |
---|
585 | { |
---|
586 | TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX) |
---|
587 | ret=1 |
---|
588 | for i in $systemlibdirs; do |
---|
589 | if [ -f "$i"/libresolv.a ]; then |
---|
590 | if echo "$RESOLV_NS_TESTCODE" | $CC -o "$TMPFILE" -x c - -Wl,"$i"/libresolv.a >/dev/null 2>/dev/null ; then |
---|
591 | ret=0 |
---|
592 | fi |
---|
593 | fi |
---|
594 | done |
---|
595 | |
---|
596 | rm -f "$TMPFILE" |
---|
597 | return $ret |
---|
598 | } |
---|
599 | |
---|
600 | detect_nameser_has_ns_types() |
---|
601 | { |
---|
602 | TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX) |
---|
603 | ret=1 |
---|
604 | # since we aren't actually linking with ns_* routines |
---|
605 | # we can just compile the test code |
---|
606 | if echo "$RESOLV_NS_TYPES_TESTCODE" | $CC -o "$TMPFILE" -x c - >/dev/null 2>/dev/null ; then |
---|
607 | ret=0 |
---|
608 | fi |
---|
609 | |
---|
610 | rm -f "$TMPFILE" |
---|
611 | return $ret |
---|
612 | } |
---|
613 | |
---|
614 | detect_backtrace() |
---|
615 | { |
---|
616 | TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX) |
---|
617 | ret=1 |
---|
618 | if echo "$BACKTRACE_TESTCODE" | $CC -o "$TMPFILE" -x c - >/dev/null 2>/dev/null ; then |
---|
619 | ret=0 |
---|
620 | fi |
---|
621 | |
---|
622 | rm -f "$TMPFILE" |
---|
623 | return $ret |
---|
624 | } |
---|
625 | |
---|
626 | if [ "$ssl" = "auto" ]; then |
---|
627 | detect_gnutls |
---|
628 | if [ "$ret" = "0" ]; then |
---|
629 | # Disable NSS for now as it's known to not work very well ATM. |
---|
630 | #detect_nss |
---|
631 | : |
---|
632 | fi |
---|
633 | elif [ "$ssl" = "gnutls" ]; then |
---|
634 | detect_gnutls |
---|
635 | elif [ "$ssl" = "nss" ]; then |
---|
636 | detect_nss |
---|
637 | elif [ "$ssl" = "openssl" ]; then |
---|
638 | echo |
---|
639 | echo 'No detection code exists for OpenSSL. Make sure that you have a complete' |
---|
640 | echo 'installation of OpenSSL (including devel/header files) before reporting' |
---|
641 | echo 'compilation problems.' |
---|
642 | echo |
---|
643 | echo 'Also, keep in mind that the OpenSSL is, according to some people, not' |
---|
644 | echo 'completely GPL-compatible. Using GnuTLS is recommended and better supported' |
---|
645 | echo 'by us. However, on many BSD machines, OpenSSL can be considered part of the' |
---|
646 | echo 'operating system, which makes it GPL-compatible.' |
---|
647 | echo |
---|
648 | echo 'For more info, see: http://www.openssl.org/support/faq.html#LEGAL2' |
---|
649 | echo ' http://www.gnome.org/~markmc/openssl-and-the-gpl.html' |
---|
650 | echo |
---|
651 | echo 'Please note that distributing a BitlBee binary which links to OpenSSL is' |
---|
652 | echo 'probably illegal. If you want to create and distribute a binary BitlBee' |
---|
653 | echo 'package, you really should use GnuTLS instead.' |
---|
654 | echo |
---|
655 | echo 'Also, the OpenSSL license requires us to say this:' |
---|
656 | echo ' * "This product includes software developed by the OpenSSL Project' |
---|
657 | echo ' * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"' |
---|
658 | |
---|
659 | echo 'EFLAGS+=-lssl -lcrypto' >> Makefile.settings |
---|
660 | |
---|
661 | ret=1 |
---|
662 | else |
---|
663 | echo |
---|
664 | echo 'ERROR: Unknown SSL library specified.' |
---|
665 | exit 1 |
---|
666 | fi |
---|
667 | |
---|
668 | if [ "$ret" = "0" ]; then |
---|
669 | echo |
---|
670 | echo 'ERROR: Could not find a suitable SSL library (GnuTLS, libnss or OpenSSL).' |
---|
671 | echo ' Please note that this script doesn'\''t have detection code for OpenSSL,' |
---|
672 | echo ' so if you want to use that, you have to select it by hand.' |
---|
673 | |
---|
674 | exit 1 |
---|
675 | fi; |
---|
676 | |
---|
677 | echo 'SSL_CLIENT=ssl_'$ssl'.o' >> Makefile.settings |
---|
678 | |
---|
679 | if detect_nameser_has_ns_types; then |
---|
680 | echo '#define NAMESER_HAS_NS_TYPES' >> config.h |
---|
681 | fi |
---|
682 | if detect_resolv_dynamic || detect_resolv_static; then |
---|
683 | echo '#define HAVE_RESOLV_A' >> config.h |
---|
684 | if detect_resolv_ns_dynamic || detect_resolv_ns_static; then |
---|
685 | echo '#define HAVE_RESOLV_A_WITH_NS' >> config.h |
---|
686 | fi |
---|
687 | else |
---|
688 | echo 'Insufficient resolv routines. Jabber server must be set explicitly' |
---|
689 | fi |
---|
690 | |
---|
691 | if detect_backtrace; then |
---|
692 | echo '#define HAVE_BACKTRACE' >> config.h |
---|
693 | echo "#define CRASHFILE \"${config}crash.log\"" >> config.h |
---|
694 | fi |
---|
695 | |
---|
696 | STORAGES="xml" |
---|
697 | |
---|
698 | for i in $STORAGES; do |
---|
699 | STORAGE_OBJS="$STORAGE_OBJS storage_$i.o" |
---|
700 | done |
---|
701 | echo "STORAGE_OBJS=$STORAGE_OBJS" >> Makefile.settings |
---|
702 | |
---|
703 | authobjs= |
---|
704 | authlibs= |
---|
705 | if [ "$pam" = "0" ]; then |
---|
706 | echo '#undef WITH_PAM' >> config.h |
---|
707 | else |
---|
708 | if ! echo '#include <security/pam_appl.h>' | $CC -E - >/dev/null 2>/dev/null; then |
---|
709 | echo 'Cannot find libpam development libraries, aborting. (Install libpam0g-dev?)' |
---|
710 | exit 1 |
---|
711 | fi |
---|
712 | echo '#define WITH_PAM' >> config.h |
---|
713 | authobjs=$authobjs'auth_pam.o ' |
---|
714 | authlibs=$authlibs'-lpam ' |
---|
715 | fi |
---|
716 | if [ "$ldap" = "0" ]; then |
---|
717 | echo '#undef WITH_LDAP' >> config.h |
---|
718 | else |
---|
719 | if ! echo '#include <ldap.h>' | $CC -E - >/dev/null 2>/dev/null; then |
---|
720 | echo 'Cannot find libldap development libraries, aborting. (Install libldap2-dev?)' |
---|
721 | exit 1 |
---|
722 | fi |
---|
723 | echo '#define WITH_LDAP' >> config.h |
---|
724 | authobjs=$authobjs'auth_ldap.o ' |
---|
725 | authlibs=$authlibs'-lldap ' |
---|
726 | fi |
---|
727 | echo AUTH_OBJS="$authobjs" >> Makefile.settings |
---|
728 | echo EFLAGS+="$authlibs" >> Makefile.settings |
---|
729 | |
---|
730 | if [ "$strip" = "0" ]; then |
---|
731 | echo "STRIP=\# skip strip" >> Makefile.settings; |
---|
732 | else |
---|
733 | if [ "$debug" = "1" ]; then |
---|
734 | echo |
---|
735 | echo 'Stripping binaries does not make sense when debugging. Stripping disabled.' |
---|
736 | echo 'STRIP=\# skip strip' >> Makefile.settings |
---|
737 | strip=0; |
---|
738 | elif [ -n "$STRIP" ]; then |
---|
739 | echo "STRIP=$STRIP" >> Makefile.settings; |
---|
740 | elif type strip > /dev/null 2> /dev/null; then |
---|
741 | echo "STRIP=strip" >> Makefile.settings; |
---|
742 | else |
---|
743 | echo |
---|
744 | echo 'No strip utility found, cannot remove unnecessary parts from executable.' |
---|
745 | echo 'STRIP=\# skip strip' >> Makefile.settings |
---|
746 | strip=0; |
---|
747 | fi; |
---|
748 | fi |
---|
749 | |
---|
750 | if [ ! "$systemd" = "0" ]; then |
---|
751 | if ! $PKG_CONFIG --exists systemd ; then |
---|
752 | if [ -n "$systemdsystemunitdir" ] || [ $systemd -eq 1 ]; then |
---|
753 | echo "systemd requested but not found" |
---|
754 | exit 1 |
---|
755 | else |
---|
756 | systemd=0 |
---|
757 | fi |
---|
758 | fi |
---|
759 | fi |
---|
760 | |
---|
761 | pkgconf_systemd_var() { |
---|
762 | # First try deprecated variable, use newer variable if not found |
---|
763 | if $PKG_CONFIG --print-variables systemd | grep -q "$1" ; then |
---|
764 | $PKG_CONFIG --variable="$1" systemd |
---|
765 | else |
---|
766 | $PKG_CONFIG --variable="$2" systemd |
---|
767 | fi |
---|
768 | } |
---|
769 | |
---|
770 | if [ "$systemd" = "1" ]; then |
---|
771 | if [ -z "$systemdsystemunitdir" ]; then |
---|
772 | systemdsystemunitdir=$(pkgconf_systemd_var systemdsystemunitdir systemd_system_unit_dir) |
---|
773 | fi |
---|
774 | if [ -z "$sysusersdir" ] ; then |
---|
775 | sysusersdir=$(pkgconf_systemd_var sysusersdir sysusers_dir) |
---|
776 | fi |
---|
777 | |
---|
778 | echo "SYSTEMDSYSTEMUNITDIR=$systemdsystemunitdir" >> Makefile.settings |
---|
779 | echo "SYSUSERSDIR=$sysusersdir" >> Makefile.settings |
---|
780 | fi |
---|
781 | |
---|
782 | if [ "$gcov" = "1" ]; then |
---|
783 | echo "CFLAGS+=--coverage" >> Makefile.settings |
---|
784 | echo "EFLAGS+=--coverage" >> Makefile.settings |
---|
785 | fi |
---|
786 | |
---|
787 | if [ "$plugins" = "0" ]; then |
---|
788 | plugindir="" |
---|
789 | echo '#undef WITH_PLUGINS' >> config.h |
---|
790 | else |
---|
791 | echo '#define WITH_PLUGINS' >> config.h |
---|
792 | fi |
---|
793 | |
---|
794 | if [ "$otr" = "auto" ]; then |
---|
795 | ! $PKG_CONFIG --exists libotr |
---|
796 | otr=$? |
---|
797 | fi |
---|
798 | |
---|
799 | if [ "$otr" != "0" ] && ! $PKG_CONFIG --atleast-version=4.0 --print-errors libotr; then |
---|
800 | exit 1 |
---|
801 | fi |
---|
802 | |
---|
803 | if [ "$otr" = "1" ]; then |
---|
804 | # BI == built-in |
---|
805 | echo '#define OTR_BI' >> config.h |
---|
806 | # shellcheck disable=SC2129 |
---|
807 | echo "EFLAGS+=$($PKG_CONFIG --libs libotr) $(libgcrypt-config --libs)" >> Makefile.settings |
---|
808 | echo "CFLAGS+=$($PKG_CONFIG --cflags libotr) $(libgcrypt-config --cflags)" >> Makefile.settings |
---|
809 | echo 'OTR_BI=otr.o' >> Makefile.settings |
---|
810 | elif [ "$otr" = "plugin" ]; then |
---|
811 | # for some mysterious reason beyond the comprehension of my mortal mind, |
---|
812 | # the libgcrypt flags aren't needed when building as plugin. add them anyway. |
---|
813 | echo '#define OTR_PI' >> config.h |
---|
814 | # shellcheck disable=SC2129 |
---|
815 | echo "OTRFLAGS=$($PKG_CONFIG --libs libotr) $(libgcrypt-config --libs)" >> Makefile.settings |
---|
816 | echo "CFLAGS+=$($PKG_CONFIG --cflags libotr) $(libgcrypt-config --cflags)" >> Makefile.settings |
---|
817 | echo 'OTR_PI=otr.so' >> Makefile.settings |
---|
818 | fi |
---|
819 | |
---|
820 | if [ -z "$PYTHON" ]; then |
---|
821 | for pp in python python3 python2; do |
---|
822 | if which $pp > /dev/null; then |
---|
823 | PYTHON=$pp |
---|
824 | break |
---|
825 | fi |
---|
826 | done |
---|
827 | fi |
---|
828 | |
---|
829 | if [ "$doc" = "1" ]; then |
---|
830 | # check this here just in case someone tries to install it in python2.4... |
---|
831 | if [ ! -e "$srcdir"/doc/user-guide/help.txt ] && ! $PYTHON -m xml.etree.ElementTree > /dev/null 2>&1; then |
---|
832 | echo |
---|
833 | echo 'ERROR: Python (>=2.5 or 3.x) is required to generate docs' |
---|
834 | echo "(Use the PYTHON environment variable if it's in a weird location)" |
---|
835 | exit 1 |
---|
836 | fi |
---|
837 | echo "DOC=1" >> Makefile.settings |
---|
838 | echo "PYTHON=$PYTHON" >> Makefile.settings |
---|
839 | fi |
---|
840 | |
---|
841 | get_version |
---|
842 | |
---|
843 | if [ ! "$BITLBEE_VERSION" = "$REAL_BITLBEE_VERSION" ]; then |
---|
844 | echo "Spoofing version number: $BITLBEE_VERSION" |
---|
845 | echo "#undef BITLBEE_VERSION" >> config.h |
---|
846 | echo '#define BITLBEE_VERSION "'$BITLBEE_VERSION'"' >> config.h |
---|
847 | echo |
---|
848 | fi |
---|
849 | |
---|
850 | if ! make helloworld > /dev/null 2>&1; then |
---|
851 | echo "WARNING: Your version of make (BSD make?) does not support BitlBee's makefiles." |
---|
852 | echo "BitlBee needs GNU make to build properly. On most systems GNU make is available" |
---|
853 | echo "under the name 'gmake'." |
---|
854 | echo |
---|
855 | if gmake helloworld > /dev/null 2>&1; then |
---|
856 | echo "gmake seems to be available on your machine, great." |
---|
857 | echo |
---|
858 | else |
---|
859 | echo "gmake is not installed (or not working). Please try to install it." |
---|
860 | echo |
---|
861 | fi |
---|
862 | fi |
---|
863 | |
---|
864 | pkgconfiglibs='' |
---|
865 | case "$arch" in |
---|
866 | CYGWIN* ) |
---|
867 | pkgconfiglibs="-L${libdir} -lbitlbee -no-undefined" |
---|
868 | esac |
---|
869 | |
---|
870 | cat <<EOF >bitlbee.pc |
---|
871 | prefix=$prefix |
---|
872 | includedir=$includedir |
---|
873 | plugindir=$plugindir |
---|
874 | libdir=$libdir |
---|
875 | datadir=$datadir |
---|
876 | |
---|
877 | Name: bitlbee |
---|
878 | Description: IRC to IM gateway |
---|
879 | Requires: glib-2.0 |
---|
880 | Version: $BITLBEE_VERSION |
---|
881 | Libs: $pkgconfiglibs |
---|
882 | Cflags: -I\${includedir} |
---|
883 | |
---|
884 | EOF |
---|
885 | |
---|
886 | protocols='' |
---|
887 | protoobjs='' |
---|
888 | |
---|
889 | if [ "$purple" = "0" ]; then |
---|
890 | echo '#undef WITH_PURPLE' >> config.h |
---|
891 | else |
---|
892 | if ! $PKG_CONFIG purple; then |
---|
893 | echo |
---|
894 | echo 'Cannot find libpurple development libraries, aborting. (Install libpurple-dev?)' |
---|
895 | exit 1 |
---|
896 | fi |
---|
897 | echo '#define WITH_PURPLE' >> config.h |
---|
898 | cat<<EOF >>Makefile.settings |
---|
899 | EFLAGS += $($PKG_CONFIG purple --libs) |
---|
900 | PURPLE_CFLAGS += $($PKG_CONFIG purple --cflags) |
---|
901 | EOF |
---|
902 | protocols=$protocols'purple ' |
---|
903 | protoobjs=$protoobjs'purple_mod.o ' |
---|
904 | |
---|
905 | # only disable these if the user didn't enable them explicitly |
---|
906 | [ "$jabber" = "default-on" ] && jabber=0 |
---|
907 | |
---|
908 | echo '#undef PACKAGE' >> config.h |
---|
909 | echo '#define PACKAGE "BitlBee-LIBPURPLE"' >> config.h |
---|
910 | |
---|
911 | if [ "$events" = "libevent" ]; then |
---|
912 | echo 'Warning: Some libpurple modules (including msn-pecan) do their event handling' |
---|
913 | echo 'outside libpurple, talking to GLib directly. At least for now the combination' |
---|
914 | echo 'libpurple + libevent is *not* recommended!' |
---|
915 | echo |
---|
916 | fi |
---|
917 | fi |
---|
918 | |
---|
919 | case "$CC" in |
---|
920 | *gcc* ) |
---|
921 | echo CFLAGS+=-MMD -MF .depend/\$@.d >> Makefile.settings |
---|
922 | for i in . lib tests protocols protocols/*/; do |
---|
923 | mkdir -p "$i"/.depend |
---|
924 | done |
---|
925 | esac |
---|
926 | |
---|
927 | if [ "$jabber" = "0" ]; then |
---|
928 | echo '#undef WITH_JABBER' >> config.h |
---|
929 | else |
---|
930 | echo '#define WITH_JABBER' >> config.h |
---|
931 | protocols=$protocols'jabber ' |
---|
932 | protoobjs=$protoobjs'jabber_mod.o ' |
---|
933 | fi |
---|
934 | |
---|
935 | if [ "$twitter" = "0" ]; then |
---|
936 | echo '#undef WITH_TWITTER' >> config.h |
---|
937 | else |
---|
938 | echo '#define WITH_TWITTER' >> config.h |
---|
939 | protocols=$protocols'twitter ' |
---|
940 | protoobjs=$protoobjs'twitter_mod.o ' |
---|
941 | fi |
---|
942 | |
---|
943 | if [ "$protocols" = "PROTOCOLS = " ]; then |
---|
944 | echo "Warning: You haven't selected any communication protocol to compile!" |
---|
945 | echo " BitlBee will run, but you will be unable to connect to IM servers!" |
---|
946 | fi |
---|
947 | |
---|
948 | echo "PROTOCOLS = $protocols" >> Makefile.settings |
---|
949 | echo "PROTOOBJS = $protoobjs" >> Makefile.settings |
---|
950 | |
---|
951 | echo Architecture: "$arch" |
---|
952 | case "$arch" in |
---|
953 | Linux ) |
---|
954 | ;; |
---|
955 | GNU/* ) |
---|
956 | ;; |
---|
957 | *BSD ) |
---|
958 | ;; |
---|
959 | Darwin ) |
---|
960 | echo 'STRIP=\# skip strip' >> Makefile.settings |
---|
961 | ;; |
---|
962 | IRIX ) |
---|
963 | ;; |
---|
964 | SunOS ) |
---|
965 | echo 'EFLAGS+=-lresolv -lnsl -lsocket' >> Makefile.settings |
---|
966 | echo 'STRIP=\# skip strip' >> Makefile.settings |
---|
967 | echo '#define NO_FD_PASSING' >> config.h |
---|
968 | if [ "$arch_rel" = "5.10" ]; then |
---|
969 | echo '#define NO_STRCASESTR' >> config.h |
---|
970 | fi |
---|
971 | ;; |
---|
972 | AIX ) |
---|
973 | echo 'EFLAGS+=-Wl,-brtl' >> Makefile.settings |
---|
974 | ;; |
---|
975 | CYGWIN* ) |
---|
976 | echo 'EFLAGS+=-Wl,--export-all,--out-implib,libbitlbee.dll.a' >> Makefile.settings |
---|
977 | echo 'IMPLIB=libbitlbee.dll.a' >> Makefile.settings |
---|
978 | ;; |
---|
979 | Windows ) |
---|
980 | echo 'Native windows compilation is not supported anymore, use cygwin instead.' |
---|
981 | ;; |
---|
982 | * ) |
---|
983 | echo 'We haven'\''t tested BitlBee on many platforms yet, yours is untested. YMMV.' |
---|
984 | echo 'Please report any problems at http://bugs.bitlbee.org/.' |
---|
985 | ;; |
---|
986 | esac |
---|
987 | |
---|
988 | if [ -n "$target" ]; then |
---|
989 | echo "Cross-compiling for: $target" |
---|
990 | fi |
---|
991 | |
---|
992 | echo |
---|
993 | echo 'Configuration done:' |
---|
994 | |
---|
995 | if [ "$debug" = "1" ]; then |
---|
996 | echo ' Debugging enabled.' |
---|
997 | else |
---|
998 | echo ' Debugging disabled.' |
---|
999 | fi |
---|
1000 | |
---|
1001 | if [ "$asan" = "1" ]; then |
---|
1002 | echo ' AddressSanitizer (ASAN) enabled.' |
---|
1003 | else |
---|
1004 | echo ' AddressSanitizer (ASAN) disabled.' |
---|
1005 | fi |
---|
1006 | |
---|
1007 | if [ "$pie" = "1" ]; then |
---|
1008 | echo ' Building PIE executable' |
---|
1009 | else |
---|
1010 | echo ' Building non-PIE executable' |
---|
1011 | fi |
---|
1012 | |
---|
1013 | if [ "$strip" = "1" ]; then |
---|
1014 | echo ' Binary stripping enabled.' |
---|
1015 | else |
---|
1016 | echo ' Binary stripping disabled.' |
---|
1017 | fi |
---|
1018 | |
---|
1019 | if [ "$otr" = "1" ]; then |
---|
1020 | echo ' Off-the-Record (OTR) Messaging enabled.' |
---|
1021 | elif [ "$otr" = "plugin" ]; then |
---|
1022 | echo ' Off-the-Record (OTR) Messaging enabled (as a plugin).' |
---|
1023 | else |
---|
1024 | echo ' Off-the-Record (OTR) Messaging disabled.' |
---|
1025 | fi |
---|
1026 | |
---|
1027 | if [ "$systemd" = "1" ]; then |
---|
1028 | echo ' systemd enabled.' |
---|
1029 | else |
---|
1030 | echo ' systemd disabled.' |
---|
1031 | fi |
---|
1032 | |
---|
1033 | echo ' Using python: '$PYTHON |
---|
1034 | |
---|
1035 | if [ "$external_json_parser" = "1" ]; then |
---|
1036 | echo ' Using system JSON parser.' |
---|
1037 | else |
---|
1038 | echo ' Using bundled JSON parser.' |
---|
1039 | fi |
---|
1040 | |
---|
1041 | echo ' Using event handler: '$events |
---|
1042 | echo ' Using SSL library: '$ssl |
---|
1043 | #echo ' Building with these storage backends: '$STORAGES |
---|
1044 | |
---|
1045 | if [ -n "$protocols" ]; then |
---|
1046 | echo ' Building with these protocols:' "$protocols""$protocols_mods" |
---|
1047 | case "$protocols" in |
---|
1048 | *purple*) |
---|
1049 | echo " Note that BitlBee-libpurple is supported on a best-effort basis. It's" |
---|
1050 | echo " not *fully* compatible with normal BitlBee. Don't use it unless you" |
---|
1051 | echo " absolutely need it (i.e. support for a certain protocol or feature)." |
---|
1052 | esac |
---|
1053 | else |
---|
1054 | echo ' Building without IM-protocol support. We wish you a lot of fun...' |
---|
1055 | fi |
---|