[b7d3cc34] | 1 | #!/bin/sh |
---|
| 2 | |
---|
| 3 | ############################## |
---|
| 4 | ## Configurer for BitlBee ## |
---|
| 5 | ## ## |
---|
| 6 | ## Copyright 2004 Lintux ## |
---|
| 7 | ## Copyright 2002 Lucumo ## |
---|
| 8 | ############################## |
---|
| 9 | |
---|
| 10 | prefix='/usr/local/' |
---|
[57da960] | 11 | bindir='$prefix/bin/' |
---|
| 12 | sbindir='$prefix/sbin/' |
---|
[b7d3cc34] | 13 | etcdir='$prefix/etc/bitlbee/' |
---|
| 14 | mandir='$prefix/share/man/' |
---|
| 15 | datadir='$prefix/share/bitlbee/' |
---|
| 16 | config='/var/lib/bitlbee/' |
---|
[85cf37f] | 17 | plugindir='$prefix/lib/bitlbee/' |
---|
| 18 | includedir='$prefix/include/bitlbee/' |
---|
[417002e] | 19 | systemdsystemunitdir='' |
---|
[85cf37f] | 20 | libevent='/usr/' |
---|
[34b17d9] | 21 | pidfile='/var/run/bitlbee.pid' |
---|
[4c225f0] | 22 | ipcsocket='' |
---|
[e506d6c] | 23 | pcdir='$prefix/lib/pkgconfig' |
---|
[25b80e9c] | 24 | systemlibdirs="/lib64 /usr/lib64 /usr/local/lib64 /lib /usr/lib /usr/local/lib" |
---|
[b7d3cc34] | 25 | |
---|
[04e2a05] | 26 | # Set these to default-on to let it be overriden by either the user or purple |
---|
| 27 | # |
---|
| 28 | # If the user sets one of these to 1, purple won't disable them. |
---|
| 29 | # Otherwise, if it's still default-on, it gets included in normal builds, |
---|
| 30 | # but not purple ones. |
---|
| 31 | msn="default-on" |
---|
| 32 | jabber="default-on" |
---|
| 33 | oscar="default-on" |
---|
| 34 | yahoo="default-on" |
---|
| 35 | |
---|
[1b221e0] | 36 | twitter=1 |
---|
[04dc563] | 37 | purple=0 |
---|
[b7d3cc34] | 38 | |
---|
[a85a8ab] | 39 | doc=1 |
---|
[b7d3cc34] | 40 | debug=0 |
---|
| 41 | strip=1 |
---|
[66b9e86e] | 42 | gcov=0 |
---|
[e2472dd] | 43 | asan=0 |
---|
[2abfbc5] | 44 | plugins=1 |
---|
[04f0c10] | 45 | otr=0 |
---|
[370899f] | 46 | skype=0 |
---|
[85cf37f] | 47 | |
---|
| 48 | events=glib |
---|
[b7d3cc34] | 49 | ssl=auto |
---|
| 50 | |
---|
[7281ad1] | 51 | pie=1 |
---|
| 52 | |
---|
[b7d3cc34] | 53 | arch=`uname -s` |
---|
| 54 | cpu=`uname -m` |
---|
| 55 | |
---|
[34afea7] | 56 | GLIB_MIN_VERSION=2.16 |
---|
[670204f] | 57 | |
---|
[b7d3cc34] | 58 | echo BitlBee configure |
---|
| 59 | |
---|
[25c4c78] | 60 | # Cygwin and Darwin don't support PIC/PIE |
---|
| 61 | case "$arch" in |
---|
[a85a8ab] | 62 | CYGWIN* ) |
---|
| 63 | pie=0;; |
---|
| 64 | Darwin ) |
---|
| 65 | pie=0;; |
---|
[25c4c78] | 66 | esac |
---|
| 67 | |
---|
[b7d3cc34] | 68 | while [ -n "$1" ]; do |
---|
| 69 | e="`expr "X$1" : 'X--\(.*=.*\)'`" |
---|
| 70 | if [ -z "$e" ]; then |
---|
| 71 | cat<<EOF |
---|
| 72 | |
---|
| 73 | Usage: $0 [OPTIONS] |
---|
| 74 | |
---|
| 75 | Option Description Default |
---|
| 76 | |
---|
| 77 | --prefix=... Directories to put files in $prefix |
---|
| 78 | --bindir=... $bindir |
---|
[57da960] | 79 | --sbindir=... $sbindir |
---|
[b7d3cc34] | 80 | --etcdir=... $etcdir |
---|
| 81 | --mandir=... $mandir |
---|
| 82 | --datadir=... $datadir |
---|
[7b23afd] | 83 | --plugindir=... $plugindir |
---|
[417002e] | 84 | --systemdsystemunitdir=... $systemdsystemunitdir |
---|
[34b17d9] | 85 | --pidfile=... $pidfile |
---|
[b7d3cc34] | 86 | --config=... $config |
---|
| 87 | |
---|
| 88 | --msn=0/1 Disable/enable MSN part $msn |
---|
| 89 | --jabber=0/1 Disable/enable Jabber part $jabber |
---|
| 90 | --oscar=0/1 Disable/enable Oscar part (ICQ, AIM) $oscar |
---|
| 91 | --yahoo=0/1 Disable/enable Yahoo part $yahoo |
---|
[4aa0f6b] | 92 | --twitter=0/1 Disable/enable Twitter part $twitter |
---|
[b7d3cc34] | 93 | |
---|
[796da03] | 94 | --purple=0/1 Disable/enable libpurple support $purple |
---|
[04f0c10] | 95 | (automatically disables other protocol modules) |
---|
[b7d3cc34] | 96 | |
---|
[a85a8ab] | 97 | --doc=0/1 Disable/enable help.txt generation $doc |
---|
[b7d3cc34] | 98 | --debug=0/1 Disable/enable debugging $debug |
---|
| 99 | --strip=0/1 Disable/enable binary stripping $strip |
---|
[7281ad1] | 100 | --pie=0/1 Build position independent executable $pie |
---|
[66b9e86e] | 101 | --gcov=0/1 Disable/enable test coverage reporting $gcov |
---|
[e2472dd] | 102 | --asan=0/1 Disable/enable AddressSanitizer $asan |
---|
[2abfbc5] | 103 | --plugins=0/1 Disable/enable plugins support $plugins |
---|
[04f0c10] | 104 | --otr=0/1/auto/plugin |
---|
| 105 | Disable/enable OTR encryption support $otr |
---|
[17f6079] | 106 | --skype=0/1/plugin |
---|
[370899f] | 107 | Disable/enable Skype support $skype |
---|
[b7d3cc34] | 108 | |
---|
[85cf37f] | 109 | --events=... Event handler (glib, libevent) $events |
---|
[e1d3f98] | 110 | --ssl=... SSL library to use (gnutls, nss, openssl, auto) |
---|
[b7d3cc34] | 111 | $ssl |
---|
[aec56b0] | 112 | |
---|
[7281ad1] | 113 | |
---|
[f1e7407] | 114 | --target=... Cross compilation target same as host |
---|
[b7d3cc34] | 115 | EOF |
---|
| 116 | exit; |
---|
| 117 | fi |
---|
| 118 | eval "$e" |
---|
| 119 | shift; |
---|
| 120 | done |
---|
| 121 | |
---|
| 122 | # Expand $prefix and get rid of double slashes |
---|
| 123 | bindir=`eval echo "$bindir/" | sed 's/\/\{1,\}/\//g'` |
---|
[57da960] | 124 | sbindir=`eval echo "$sbindir/" | sed 's/\/\{1,\}/\//g'` |
---|
[b7d3cc34] | 125 | etcdir=`eval echo "$etcdir/" | sed 's/\/\{1,\}/\//g'` |
---|
| 126 | mandir=`eval echo "$mandir/" | sed 's/\/\{1,\}/\//g'` |
---|
| 127 | datadir=`eval echo "$datadir/" | sed 's/\/\{1,\}/\//g'` |
---|
| 128 | config=`eval echo "$config/" | sed 's/\/\{1,\}/\//g'` |
---|
[7b23afd] | 129 | plugindir=`eval echo "$plugindir/" | sed 's/\/\{1,\}/\//g'` |
---|
[85cf37f] | 130 | includedir=`eval echo "$includedir"/ | sed 's/\/\{1,\}/\//g'` |
---|
| 131 | libevent=`eval echo "$libevent"/ | sed 's/\/\{1,\}/\//g'` |
---|
| 132 | |
---|
[6dff9d4] | 133 | pidfile=`eval echo "$pidfile" | sed 's/\/\{1,\}/\//g'` |
---|
| 134 | ipcsocket=`eval echo "$ipcsocket" | sed 's/\/\{1,\}/\//g'` |
---|
[e506d6c] | 135 | pcdir=`eval echo "$pcdir" | sed 's/\/\{1,\}/\//g'` |
---|
[b7d3cc34] | 136 | |
---|
[17f6079] | 137 | protocols_mods="" |
---|
| 138 | |
---|
[b95b0c8] | 139 | cat <<EOF >Makefile.settings |
---|
[b7d3cc34] | 140 | ## BitlBee settings, generated by configure |
---|
| 141 | PREFIX=$prefix |
---|
| 142 | BINDIR=$bindir |
---|
[57da960] | 143 | SBINDIR=$sbindir |
---|
[b7d3cc34] | 144 | ETCDIR=$etcdir |
---|
| 145 | MANDIR=$mandir |
---|
| 146 | DATADIR=$datadir |
---|
[7b23afd] | 147 | PLUGINDIR=$plugindir |
---|
[b7d3cc34] | 148 | CONFIG=$config |
---|
[e506d6c] | 149 | INCLUDEDIR=$includedir |
---|
| 150 | PCDIR=$pcdir |
---|
[b7d3cc34] | 151 | |
---|
[1bf9492] | 152 | TARGET=$target |
---|
[b7d3cc34] | 153 | ARCH=$arch |
---|
| 154 | CPU=$cpu |
---|
| 155 | |
---|
[25b80e9c] | 156 | INSTALL=install -p |
---|
| 157 | |
---|
[b7d3cc34] | 158 | DESTDIR= |
---|
| 159 | LFLAGS= |
---|
[7a80925] | 160 | EFLAGS=-lm |
---|
[b7d3cc34] | 161 | EOF |
---|
| 162 | |
---|
[1074806] | 163 | srcdir=$(cd $(dirname $0);pwd) |
---|
| 164 | currdir=$(pwd) |
---|
| 165 | if [ "$srcdir" != "$currdir" ]; then |
---|
[f60079b] | 166 | echo |
---|
| 167 | echo "configure script run from a different directory. Will create some symlinks..." |
---|
| 168 | if [ ! -e Makefile -o -L Makefile ]; then |
---|
[04dc563] | 169 | COPYDIRS="doc lib protocols tests utils" |
---|
| 170 | mkdir -p $(cd "$srcdir"; find $COPYDIRS -type d) |
---|
[f60079b] | 171 | find . -name Makefile -type l -print0 | xargs -0 rm 2> /dev/null |
---|
| 172 | dst="$PWD" |
---|
| 173 | cd "$srcdir" |
---|
[04dc563] | 174 | for i in $(find . -name Makefile -type f); do |
---|
[f60079b] | 175 | ln -s "$PWD${i#.}" "$dst/$i"; |
---|
| 176 | done |
---|
| 177 | cd "$dst" |
---|
| 178 | rm -rf .bzr |
---|
| 179 | fi |
---|
| 180 | |
---|
[7fa5c19] | 181 | echo "_SRCDIR_=$srcdir/" >> Makefile.settings |
---|
[f60079b] | 182 | CFLAGS="$CFLAGS -I${dst}" |
---|
| 183 | else |
---|
| 184 | srcdir=$PWD |
---|
| 185 | fi |
---|
| 186 | |
---|
[b95b0c8] | 187 | cat<<EOF >config.h |
---|
[b7d3cc34] | 188 | /* BitlBee settings, generated by configure |
---|
| 189 | |
---|
| 190 | Do *NOT* use any of these defines in your code without thinking twice, most |
---|
| 191 | of them can/will be overridden at run-time */ |
---|
| 192 | |
---|
| 193 | #define CONFIG "$config" |
---|
| 194 | #define ETCDIR "$etcdir" |
---|
| 195 | #define VARDIR "$datadir" |
---|
[7b23afd] | 196 | #define PLUGINDIR "$plugindir" |
---|
[34b17d9] | 197 | #define PIDFILE "$pidfile" |
---|
[6dff9d4] | 198 | #define IPCSOCKET "$ipcsocket" |
---|
[b7d3cc34] | 199 | #define ARCH "$arch" |
---|
| 200 | #define CPU "$cpu" |
---|
| 201 | EOF |
---|
| 202 | |
---|
[1bf9492] | 203 | |
---|
| 204 | |
---|
[f1e7407] | 205 | if [ -n "$target" ]; then |
---|
[1bf9492] | 206 | PKG_CONFIG_LIBDIR=/usr/$target/lib/pkgconfig |
---|
| 207 | export PKG_CONFIG_LIBDIR |
---|
[f1e7407] | 208 | PATH=/usr/$target/bin:$PATH |
---|
| 209 | CC=$target-cc |
---|
| 210 | LD=$target-ld |
---|
[1bf9492] | 211 | systemlibdirs="/usr/$target/lib" |
---|
[f1e7407] | 212 | fi |
---|
| 213 | |
---|
[e2472dd] | 214 | if [ "$asan" = "1" ]; then |
---|
| 215 | CFLAGS="$CFLAGS -fsanitize=address" |
---|
| 216 | LDFLAGS="$LDFLAGS -fsanitize=address" |
---|
| 217 | debug=1 |
---|
| 218 | fi |
---|
[1bf9492] | 219 | |
---|
[b7d3cc34] | 220 | if [ "$debug" = "1" ]; then |
---|
| 221 | echo 'DEBUG=1' >> Makefile.settings |
---|
[e2472dd] | 222 | CFLAGS="$CFLAGS -g3 -DDEBUG -O0" |
---|
[b7d3cc34] | 223 | else |
---|
[56f260a] | 224 | [ -z "$CFLAGS" ] && CFLAGS="-O2 -fno-strict-aliasing" |
---|
[b7d3cc34] | 225 | fi |
---|
| 226 | |
---|
[7281ad1] | 227 | if [ "$pie" = "1" ]; then |
---|
| 228 | echo 'CFLAGS_BITLBEE=-fPIE' >> Makefile.settings |
---|
| 229 | echo 'LDFLAGS_BITLBEE=-pie' >> Makefile.settings |
---|
| 230 | fi |
---|
| 231 | |
---|
[d203495] | 232 | echo LDFLAGS=$LDFLAGS >> Makefile.settings |
---|
| 233 | |
---|
[daae10f] | 234 | echo CFLAGS=$CFLAGS $CPPFLAGS >> Makefile.settings |
---|
[f60079b] | 235 | echo CFLAGS+=-I${srcdir} -I${srcdir}/lib -I${srcdir}/protocols -I. >> Makefile.settings |
---|
[b7d3cc34] | 236 | |
---|
[41a94dd] | 237 | echo CFLAGS+=-DHAVE_CONFIG_H -D_GNU_SOURCE >> Makefile.settings |
---|
[f712188] | 238 | |
---|
[b7d3cc34] | 239 | if [ -n "$CC" ]; then |
---|
[5973412] | 240 | CC=$CC |
---|
[b7d3cc34] | 241 | elif type gcc > /dev/null 2> /dev/null; then |
---|
[5973412] | 242 | CC=gcc |
---|
[b7d3cc34] | 243 | elif type cc > /dev/null 2> /dev/null; then |
---|
[5973412] | 244 | CC=cc |
---|
[b7d3cc34] | 245 | else |
---|
| 246 | echo 'Cannot find a C compiler, aborting.' |
---|
| 247 | exit 1; |
---|
| 248 | fi |
---|
| 249 | |
---|
[5973412] | 250 | echo "CC=$CC" >> Makefile.settings; |
---|
[daae10f] | 251 | if echo $CC | grep -qw gcc; then |
---|
| 252 | # Apparently -Wall is gcc-specific? |
---|
| 253 | echo CFLAGS+=-Wall >> Makefile.settings |
---|
| 254 | fi |
---|
[5973412] | 255 | |
---|
[f1e7407] | 256 | if [ -z "$LD" ]; then |
---|
| 257 | if type ld > /dev/null 2> /dev/null; then |
---|
| 258 | LD=ld |
---|
| 259 | else |
---|
| 260 | echo 'Cannot find ld, aborting.' |
---|
| 261 | exit 1; |
---|
| 262 | fi |
---|
[b7d3cc34] | 263 | fi |
---|
| 264 | |
---|
[f1e7407] | 265 | echo "LD=$LD" >> Makefile.settings |
---|
| 266 | |
---|
[32c632f] | 267 | if [ -z "$PKG_CONFIG" ]; then |
---|
| 268 | PKG_CONFIG=pkg-config |
---|
| 269 | fi |
---|
| 270 | |
---|
| 271 | if $PKG_CONFIG --version > /dev/null 2>/dev/null && $PKG_CONFIG glib-2.0; then |
---|
[670204f] | 272 | if $PKG_CONFIG glib-2.0 --atleast-version=$GLIB_MIN_VERSION; then |
---|
[b95b0c8] | 273 | cat<<EOF >>Makefile.settings |
---|
[32c632f] | 274 | EFLAGS+=`$PKG_CONFIG --libs glib-2.0 gmodule-2.0` |
---|
| 275 | CFLAGS+=`$PKG_CONFIG --cflags glib-2.0 gmodule-2.0` |
---|
[b7d3cc34] | 276 | EOF |
---|
[670204f] | 277 | else |
---|
| 278 | echo |
---|
| 279 | echo 'Found glib2 '`$PKG_CONFIG glib-2.0 --modversion`', but version '$GLIB_MIN_VERSION' or newer is required.' |
---|
| 280 | exit 1 |
---|
| 281 | fi |
---|
[b7d3cc34] | 282 | else |
---|
[670204f] | 283 | echo |
---|
[574af7e] | 284 | echo 'Cannot find glib2 development libraries, aborting. (Install libglib2-dev?)' |
---|
[670204f] | 285 | exit 1 |
---|
[b7d3cc34] | 286 | fi |
---|
| 287 | |
---|
[85cf37f] | 288 | if [ "$events" = "libevent" ]; then |
---|
[003553b] | 289 | if ! [ -f "${libevent}include/event.h" ]; then |
---|
[85cf37f] | 290 | echo |
---|
| 291 | echo 'Warning: Could not find event.h, you might have to install it and/or specify' |
---|
| 292 | echo 'its location using the --libevent= argument. (Example: If event.h is in' |
---|
| 293 | echo '/usr/local/include and binaries are in /usr/local/lib: --libevent=/usr/local)' |
---|
| 294 | fi |
---|
| 295 | |
---|
| 296 | echo '#define EVENTS_LIBEVENT' >> config.h |
---|
[b95b0c8] | 297 | cat <<EOF >>Makefile.settings |
---|
[85cf37f] | 298 | EFLAGS+=-levent -L${libevent}lib |
---|
| 299 | CFLAGS+=-I${libevent}include |
---|
| 300 | EOF |
---|
| 301 | elif [ "$events" = "glib" ]; then |
---|
| 302 | ## We already use glib anyway, so this is all we need (and in fact not even this, but just to be sure...): |
---|
| 303 | echo '#define EVENTS_GLIB' >> config.h |
---|
[b7d3cc34] | 304 | else |
---|
| 305 | echo |
---|
[85cf37f] | 306 | echo 'ERROR: Unknown event handler specified.' |
---|
| 307 | exit 1 |
---|
[b7d3cc34] | 308 | fi |
---|
[85cf37f] | 309 | echo 'EVENT_HANDLER=events_'$events'.o' >> Makefile.settings |
---|
[b7d3cc34] | 310 | |
---|
| 311 | detect_gnutls() |
---|
| 312 | { |
---|
[4af7b4f] | 313 | if $PKG_CONFIG --exists gnutls; then |
---|
[b95b0c8] | 314 | cat <<EOF >>Makefile.settings |
---|
[83e47ec] | 315 | EFLAGS+=`$PKG_CONFIG --libs gnutls` `libgcrypt-config --libs` |
---|
| 316 | CFLAGS+=`$PKG_CONFIG --cflags gnutls` `libgcrypt-config --cflags` |
---|
[4af7b4f] | 317 | EOF |
---|
| 318 | ssl=gnutls |
---|
[5513f3e] | 319 | if ! pkg-config gnutls --atleast-version=2.8; then |
---|
| 320 | echo |
---|
| 321 | echo 'Warning: With GnuTLS versions <2.8, certificate expire dates are not verified.' |
---|
| 322 | fi |
---|
[4af7b4f] | 323 | ret=1 |
---|
| 324 | elif libgnutls-config --version > /dev/null 2> /dev/null; then |
---|
[b95b0c8] | 325 | cat <<EOF >>Makefile.settings |
---|
[83e47ec] | 326 | EFLAGS+=`libgnutls-config --libs` `libgcrypt-config --libs` |
---|
| 327 | CFLAGS+=`libgnutls-config --cflags` `libgcrypt-config --cflags` |
---|
[b7d3cc34] | 328 | EOF |
---|
| 329 | |
---|
| 330 | ssl=gnutls |
---|
| 331 | ret=1; |
---|
| 332 | else |
---|
| 333 | ret=0; |
---|
| 334 | fi; |
---|
| 335 | } |
---|
| 336 | |
---|
| 337 | detect_nss() |
---|
| 338 | { |
---|
[ef043d3] | 339 | if $PKG_CONFIG --version > /dev/null 2>/dev/null && $PKG_CONFIG nss; then |
---|
[b95b0c8] | 340 | cat<<EOF >>Makefile.settings |
---|
[ef043d3] | 341 | EFLAGS+=`$PKG_CONFIG --libs nss` |
---|
| 342 | CFLAGS+=`$PKG_CONFIG --cflags nss` |
---|
[b7d3cc34] | 343 | EOF |
---|
| 344 | |
---|
| 345 | ssl=nss |
---|
| 346 | ret=1; |
---|
| 347 | else |
---|
| 348 | ret=0; |
---|
| 349 | fi; |
---|
| 350 | } |
---|
| 351 | |
---|
[36cf9fd] | 352 | RESOLV_TESTCODE=' |
---|
[aee8c19] | 353 | #include <sys/types.h> |
---|
| 354 | #include <netinet/in.h> |
---|
[36cf9fd] | 355 | #include <arpa/nameser.h> |
---|
| 356 | #include <resolv.h> |
---|
| 357 | |
---|
[632627e] | 358 | int main() |
---|
| 359 | { |
---|
| 360 | |
---|
| 361 | res_query( NULL, 0, 0, NULL, 0); |
---|
| 362 | dn_expand( NULL, NULL, NULL, NULL, 0); |
---|
| 363 | dn_skipname( NULL, NULL); |
---|
| 364 | } |
---|
| 365 | ' |
---|
| 366 | RESOLV_NS_TESTCODE=' |
---|
| 367 | #include <sys/types.h> |
---|
| 368 | #include <netinet/in.h> |
---|
| 369 | #include <arpa/nameser.h> |
---|
| 370 | #include <resolv.h> |
---|
| 371 | |
---|
[36cf9fd] | 372 | int main() |
---|
| 373 | { |
---|
| 374 | ns_initparse( NULL, 0, NULL ); |
---|
| 375 | ns_parserr( NULL, ns_s_an, 0, NULL ); |
---|
| 376 | } |
---|
| 377 | ' |
---|
[632627e] | 378 | RESOLV_NS_TYPES_TESTCODE=' |
---|
| 379 | #include <sys/types.h> |
---|
| 380 | #include <netinet/in.h> |
---|
| 381 | #include <arpa/nameser.h> |
---|
| 382 | |
---|
| 383 | int main() |
---|
| 384 | { |
---|
| 385 | ns_msg nsh; |
---|
| 386 | ns_rr rr; |
---|
| 387 | |
---|
[fb87924] | 388 | /* Not all platforms we want to work on have |
---|
| 389 | ns_* routines, so use this to make sure |
---|
| 390 | the compiler uses it.*/ |
---|
| 391 | return (int)(sizeof(nsh) + sizeof(rr)); |
---|
[632627e] | 392 | } |
---|
| 393 | ' |
---|
[36cf9fd] | 394 | |
---|
| 395 | detect_resolv_dynamic() |
---|
| 396 | { |
---|
[aee8c19] | 397 | case "$arch" in |
---|
[632627e] | 398 | OpenBSD ) |
---|
| 399 | # In FreeBSD res_*/dn_* routines are present in libc.so |
---|
| 400 | LIBRESOLV=;; |
---|
[aee8c19] | 401 | FreeBSD ) |
---|
[632627e] | 402 | # In FreeBSD res_*/dn_* routines are present in libc.so |
---|
| 403 | LIBRESOLV=;; |
---|
| 404 | CYGWIN* ) |
---|
| 405 | # In Cygwin res_*/dn_* routines are present in libc.so |
---|
[aee8c19] | 406 | LIBRESOLV=;; |
---|
| 407 | * ) |
---|
| 408 | LIBRESOLV=-lresolv;; |
---|
| 409 | esac |
---|
[4fca1db] | 410 | TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX) |
---|
[8462239] | 411 | ret=1 |
---|
[aee8c19] | 412 | echo "$RESOLV_TESTCODE" | $CC -o $TMPFILE -x c - $LIBRESOLV >/dev/null 2>/dev/null |
---|
[36cf9fd] | 413 | if [ "$?" = "0" ]; then |
---|
[aee8c19] | 414 | echo "EFLAGS+=$LIBRESOLV" >> Makefile.settings |
---|
[8462239] | 415 | ret=0 |
---|
[36cf9fd] | 416 | fi |
---|
| 417 | |
---|
[8462239] | 418 | rm -f $TMPFILE |
---|
| 419 | return $ret |
---|
[36cf9fd] | 420 | } |
---|
| 421 | |
---|
| 422 | detect_resolv_static() |
---|
| 423 | { |
---|
[4fca1db] | 424 | TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX) |
---|
[8462239] | 425 | ret=1 |
---|
[36cf9fd] | 426 | for i in $systemlibdirs; do |
---|
| 427 | if [ -f $i/libresolv.a ]; then |
---|
[8462239] | 428 | echo "$RESOLV_TESTCODE" | $CC -o $TMPFILE -x c - -Wl,$i/libresolv.a >/dev/null 2>/dev/null |
---|
[36cf9fd] | 429 | if [ "$?" = "0" ]; then |
---|
| 430 | echo 'EFLAGS+='$i'/libresolv.a' >> Makefile.settings |
---|
[8462239] | 431 | ret=0 |
---|
[36cf9fd] | 432 | fi |
---|
| 433 | fi |
---|
| 434 | done |
---|
| 435 | |
---|
[8462239] | 436 | rm -f $TMPFILE |
---|
| 437 | return $ret |
---|
[36cf9fd] | 438 | } |
---|
| 439 | |
---|
[632627e] | 440 | detect_resolv_ns_dynamic() |
---|
| 441 | { |
---|
| 442 | case "$arch" in |
---|
| 443 | FreeBSD ) |
---|
| 444 | # In FreeBSD ns_ routines are present in libc.so |
---|
| 445 | LIBRESOLV=;; |
---|
| 446 | * ) |
---|
| 447 | LIBRESOLV=-lresolv;; |
---|
| 448 | esac |
---|
| 449 | TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX) |
---|
| 450 | ret=1 |
---|
| 451 | echo "$RESOLV_NS_TESTCODE" | $CC -o $TMPFILE -x c - $LIBRESOLV >/dev/null 2>/dev/null |
---|
| 452 | if [ "$?" = "0" ]; then |
---|
| 453 | ret=0 |
---|
| 454 | fi |
---|
| 455 | |
---|
| 456 | rm -f $TMPFILE |
---|
| 457 | return $ret |
---|
| 458 | } |
---|
| 459 | |
---|
| 460 | detect_resolv_ns_static() |
---|
| 461 | { |
---|
| 462 | TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX) |
---|
| 463 | ret=1 |
---|
| 464 | for i in $systemlibdirs; do |
---|
| 465 | if [ -f $i/libresolv.a ]; then |
---|
| 466 | echo "$RESOLV_NS_TESTCODE" | $CC -o $TMPFILE -x c - -Wl,$i/libresolv.a >/dev/null 2>/dev/null |
---|
| 467 | if [ "$?" = "0" ]; then |
---|
| 468 | ret=0 |
---|
| 469 | fi |
---|
| 470 | fi |
---|
| 471 | done |
---|
| 472 | |
---|
| 473 | rm -f $TMPFILE |
---|
| 474 | return $ret |
---|
| 475 | } |
---|
| 476 | |
---|
| 477 | detect_nameser_has_ns_types() |
---|
| 478 | { |
---|
[fb87924] | 479 | TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX) |
---|
| 480 | ret=1 |
---|
| 481 | # since we aren't actually linking with ns_* routines |
---|
| 482 | # we can just compile the test code |
---|
| 483 | echo "$RESOLV_NS_TYPES_TESTCODE" | $CC -o $TMPFILE -x c - >/dev/null 2>/dev/null |
---|
| 484 | if [ "$?" = "0" ]; then |
---|
| 485 | ret=0 |
---|
[632627e] | 486 | fi |
---|
| 487 | |
---|
[fb87924] | 488 | rm -f $TMPFILE |
---|
| 489 | return $ret |
---|
[632627e] | 490 | } |
---|
| 491 | |
---|
[b3c467b] | 492 | if [ "$ssl" = "auto" ]; then |
---|
| 493 | detect_gnutls |
---|
[b7d3cc34] | 494 | if [ "$ret" = "0" ]; then |
---|
[c5920df] | 495 | # Disable NSS for now as it's known to not work very well ATM. |
---|
| 496 | #detect_nss |
---|
[191cfb1] | 497 | : |
---|
[b7d3cc34] | 498 | fi |
---|
[b3c467b] | 499 | elif [ "$ssl" = "gnutls" ]; then |
---|
| 500 | detect_gnutls |
---|
| 501 | elif [ "$ssl" = "nss" ]; then |
---|
| 502 | detect_nss |
---|
| 503 | elif [ "$ssl" = "openssl" ]; then |
---|
| 504 | echo |
---|
| 505 | echo 'No detection code exists for OpenSSL. Make sure that you have a complete' |
---|
[b3eee9b] | 506 | echo 'installation of OpenSSL (including devel/header files) before reporting' |
---|
[b3c467b] | 507 | echo 'compilation problems.' |
---|
| 508 | echo |
---|
| 509 | echo 'Also, keep in mind that the OpenSSL is, according to some people, not' |
---|
[b3eee9b] | 510 | echo 'completely GPL-compatible. Using GnuTLS is recommended and better supported' |
---|
| 511 | echo 'by us. However, on many BSD machines, OpenSSL can be considered part of the' |
---|
| 512 | echo 'operating system, which makes it GPL-compatible.' |
---|
[b3c467b] | 513 | echo |
---|
| 514 | echo 'For more info, see: http://www.openssl.org/support/faq.html#LEGAL2' |
---|
| 515 | echo ' http://www.gnome.org/~markmc/openssl-and-the-gpl.html' |
---|
| 516 | echo |
---|
| 517 | echo 'Please note that distributing a BitlBee binary which links to OpenSSL is' |
---|
| 518 | echo 'probably illegal. If you want to create and distribute a binary BitlBee' |
---|
[b3eee9b] | 519 | echo 'package, you really should use GnuTLS instead.' |
---|
[b3c467b] | 520 | echo |
---|
| 521 | echo 'Also, the OpenSSL license requires us to say this:' |
---|
| 522 | echo ' * "This product includes software developed by the OpenSSL Project' |
---|
| 523 | echo ' * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"' |
---|
[b7d3cc34] | 524 | |
---|
[b3c467b] | 525 | echo 'EFLAGS+=-lssl -lcrypto' >> Makefile.settings |
---|
| 526 | |
---|
| 527 | ret=1 |
---|
| 528 | else |
---|
| 529 | echo |
---|
| 530 | echo 'ERROR: Unknown SSL library specified.' |
---|
| 531 | exit 1 |
---|
[b7d3cc34] | 532 | fi |
---|
| 533 | |
---|
[b3c467b] | 534 | if [ "$ret" = "0" ]; then |
---|
| 535 | echo |
---|
| 536 | echo 'ERROR: Could not find a suitable SSL library (GnuTLS, libnss or OpenSSL).' |
---|
| 537 | echo ' Please note that this script doesn'\''t have detection code for OpenSSL,' |
---|
[e1d3f98] | 538 | echo ' so if you want to use that, you have to select it by hand.' |
---|
[b7d3cc34] | 539 | |
---|
[b3c467b] | 540 | exit 1 |
---|
| 541 | fi; |
---|
| 542 | |
---|
| 543 | echo 'SSL_CLIENT=ssl_'$ssl'.o' >> Makefile.settings |
---|
| 544 | |
---|
[632627e] | 545 | if detect_nameser_has_ns_types; then |
---|
| 546 | echo '#define NAMESER_HAS_NS_TYPES' >> config.h |
---|
| 547 | fi |
---|
[36cf9fd] | 548 | if detect_resolv_dynamic || detect_resolv_static; then |
---|
| 549 | echo '#define HAVE_RESOLV_A' >> config.h |
---|
[632627e] | 550 | if detect_resolv_ns_dynamic || detect_resolv_ns_static; then |
---|
| 551 | echo '#define HAVE_RESOLV_A_WITH_NS' >> config.h |
---|
| 552 | fi |
---|
| 553 | else |
---|
| 554 | echo 'Insufficient resolv routines. Jabber server must be set explicitly' |
---|
[36cf9fd] | 555 | fi |
---|
[36e9f62] | 556 | |
---|
[632627e] | 557 | |
---|
[ba7d16f] | 558 | STORAGES="xml" |
---|
[b3c467b] | 559 | |
---|
| 560 | for i in $STORAGES; do |
---|
| 561 | STORAGE_OBJS="$STORAGE_OBJS storage_$i.o" |
---|
| 562 | done |
---|
| 563 | echo "STORAGE_OBJS="$STORAGE_OBJS >> Makefile.settings |
---|
| 564 | |
---|
[b7d3cc34] | 565 | if [ "$strip" = 0 ]; then |
---|
| 566 | echo "STRIP=\# skip strip" >> Makefile.settings; |
---|
| 567 | else |
---|
| 568 | if [ "$debug" = 1 ]; then |
---|
| 569 | echo |
---|
| 570 | echo 'Stripping binaries does not make sense when debugging. Stripping disabled.' |
---|
| 571 | echo 'STRIP=\# skip strip' >> Makefile.settings |
---|
| 572 | strip=0; |
---|
| 573 | elif [ -n "$STRIP" ]; then |
---|
| 574 | echo "STRIP=$STRIP" >> Makefile.settings; |
---|
| 575 | elif type strip > /dev/null 2> /dev/null; then |
---|
| 576 | echo "STRIP=strip" >> Makefile.settings; |
---|
| 577 | else |
---|
| 578 | echo |
---|
| 579 | echo 'No strip utility found, cannot remove unnecessary parts from executable.' |
---|
| 580 | echo 'STRIP=\# skip strip' >> Makefile.settings |
---|
| 581 | strip=0; |
---|
| 582 | fi; |
---|
| 583 | fi |
---|
| 584 | |
---|
[417002e] | 585 | if [ -z "$systemdsystemunitdir" ]; then |
---|
| 586 | if $PKG_CONFIG --exists systemd; then |
---|
| 587 | systemdsystemunitdir=`$PKG_CONFIG --variable=systemdsystemunitdir systemd` |
---|
| 588 | fi |
---|
| 589 | fi |
---|
| 590 | if [ -n "$systemdsystemunitdir" ]; then |
---|
| 591 | if [ "$systemdsystemunitdir" != "no" ]; then |
---|
| 592 | echo "SYSTEMDSYSTEMUNITDIR=$systemdsystemunitdir" >> Makefile.settings |
---|
| 593 | fi |
---|
| 594 | fi |
---|
| 595 | |
---|
[66b9e86e] | 596 | if [ "$gcov" = "1" ]; then |
---|
[31fc3970] | 597 | echo "CFLAGS+=--coverage" >> Makefile.settings |
---|
| 598 | echo "EFLAGS+=--coverage" >> Makefile.settings |
---|
[66b9e86e] | 599 | fi |
---|
| 600 | |
---|
[2abfbc5] | 601 | if [ "$plugins" = 0 ]; then |
---|
[489847f] | 602 | plugindir="" |
---|
[2abfbc5] | 603 | echo '#undef WITH_PLUGINS' >> config.h |
---|
| 604 | else |
---|
| 605 | echo '#define WITH_PLUGINS' >> config.h |
---|
| 606 | fi |
---|
| 607 | |
---|
[6738a67] | 608 | otrprefix="" |
---|
| 609 | for i in / /usr /usr/local; do |
---|
| 610 | if [ -f ${i}/lib/libotr.a ]; then |
---|
| 611 | otrprefix=${i} |
---|
| 612 | break |
---|
| 613 | fi |
---|
| 614 | done |
---|
[764c7d1] | 615 | if [ "$otr" = "auto" ]; then |
---|
[6738a67] | 616 | if [ -n "$otrprefix" ]; then |
---|
| 617 | otr=1 |
---|
| 618 | else |
---|
| 619 | otr=0 |
---|
| 620 | fi |
---|
[764c7d1] | 621 | fi |
---|
[6738a67] | 622 | if [ "$otr" = 1 ]; then |
---|
[858ea01] | 623 | # BI == built-in |
---|
| 624 | echo '#define OTR_BI' >> config.h |
---|
[d348377] | 625 | echo "EFLAGS+=-L${otrprefix}/lib -lotr -lgcrypt" >> Makefile.settings |
---|
[6738a67] | 626 | echo "CFLAGS+=-I${otrprefix}/include" >> Makefile.settings |
---|
[858ea01] | 627 | echo 'OTR_BI=otr.o' >> Makefile.settings |
---|
| 628 | elif [ "$otr" = "plugin" ]; then |
---|
| 629 | echo '#define OTR_PI' >> config.h |
---|
| 630 | echo "OTRFLAGS=-L${otrprefix}/lib -lotr" >> Makefile.settings |
---|
| 631 | echo "CFLAGS+=-I${otrprefix}/include" >> Makefile.settings |
---|
| 632 | echo 'OTR_PI=otr.so' >> Makefile.settings |
---|
[764c7d1] | 633 | fi |
---|
[a8aa823] | 634 | if [ "$otr" != 0 ] && ! pkg-config libotr --atleast-version=4.0; then |
---|
| 635 | echo |
---|
| 636 | echo 'WARNING: Your libotr seems to be old. BitlBee now needs at least libotr 4.0.' |
---|
| 637 | # Not hard-failing because the code above doesn't use pkg-config, so who knows |
---|
| 638 | # what's true at this point... |
---|
| 639 | fi |
---|
[764c7d1] | 640 | |
---|
[17f6079] | 641 | if [ "$skype" = "1" -o "$skype" = "plugin" ]; then |
---|
[b2b7f52] | 642 | if [ "$arch" = "Darwin" ]; then |
---|
| 643 | echo "SKYPEFLAGS=-dynamiclib -undefined dynamic_lookup" >> Makefile.settings |
---|
| 644 | else |
---|
| 645 | echo "SKYPEFLAGS=-fPIC -shared" >> Makefile.settings |
---|
| 646 | fi |
---|
[370899f] | 647 | echo 'SKYPE_PI=skype.so' >> Makefile.settings |
---|
[17f6079] | 648 | protocols_mods="$protocol_mods skype(plugin)" |
---|
[370899f] | 649 | fi |
---|
| 650 | |
---|
[a85a8ab] | 651 | if [ "$doc" = "1" ]; then |
---|
| 652 | if [ ! -e doc/user-guide/help.txt ] && \ |
---|
| 653 | ! type xmlto > /dev/null 2> /dev/null || \ |
---|
| 654 | ! type xsltproc > /dev/null 2> /dev/null |
---|
| 655 | then |
---|
| 656 | echo |
---|
| 657 | echo 'WARNING: Building from an unreleased source tree without prebuilt helpfile.' |
---|
| 658 | echo 'Install xmlto and xsltproc if you want online help to work.' |
---|
| 659 | else |
---|
| 660 | echo "DOC=1" >> Makefile.settings |
---|
| 661 | fi |
---|
| 662 | |
---|
| 663 | if [ "$skype" = "1" -o "$skype" = "plugin" ]; then |
---|
| 664 | # skype also needs asciidoc |
---|
| 665 | if ! type a2x > /dev/null 2> /dev/null; then |
---|
| 666 | echo |
---|
| 667 | echo 'WARNING: The skyped man page requires asciidoc. It will not be generated.' |
---|
| 668 | else |
---|
| 669 | echo "ASCIIDOC=1" >> Makefile.settings |
---|
| 670 | fi |
---|
| 671 | fi |
---|
[ceebeb1] | 672 | fi |
---|
| 673 | |
---|
[f287f04] | 674 | REAL_BITLBEE_VERSION=`grep '^#define BITLBEE_VERSION ' $srcdir/bitlbee.h | sed 's/.*\"\(.*\)\".*/\1/'` |
---|
[ffea9b9] | 675 | echo |
---|
[a014331] | 676 | if [ -z "$BITLBEE_VERSION" -a -d .bzr ] && type bzr > /dev/null 2> /dev/null; then |
---|
| 677 | nick=`bzr nick` |
---|
| 678 | if [ -n "$nick" -a "$nick" != "bitlbee" ]; then |
---|
| 679 | nick="-$nick" |
---|
| 680 | else |
---|
| 681 | nick="" |
---|
| 682 | fi |
---|
[ffea9b9] | 683 | rev=`bzr revno` |
---|
| 684 | echo 'Using bzr revision #'$rev' as version number' |
---|
[f287f04] | 685 | BITLBEE_VERSION=$REAL_BITLBEE_VERSION-bzr$nick-$rev |
---|
[b7d3cc34] | 686 | fi |
---|
| 687 | |
---|
[e26aa72] | 688 | if [ -z "$BITLBEE_VERSION" -a -d .git ] && type git > /dev/null 2> /dev/null; then |
---|
| 689 | rev=`git describe --long --tags`-`git rev-parse --abbrev-ref HEAD` |
---|
| 690 | echo 'Using '$rev' as git version number' |
---|
| 691 | BITLBEE_VERSION=$rev-git |
---|
| 692 | fi |
---|
| 693 | |
---|
[b7d3cc34] | 694 | if [ -n "$BITLBEE_VERSION" ]; then |
---|
| 695 | echo 'Spoofing version number: '$BITLBEE_VERSION |
---|
| 696 | echo '#undef BITLBEE_VERSION' >> config.h |
---|
[f287f04] | 697 | echo '#define BITLBEE_VERSION "'$BITLBEE_VERSION'"' >> config.h |
---|
[ffea9b9] | 698 | echo |
---|
[f287f04] | 699 | else |
---|
| 700 | # for pkg-config |
---|
| 701 | BITLBEE_VERSION=$REAL_BITLBEE_VERSION |
---|
[b7d3cc34] | 702 | fi |
---|
| 703 | |
---|
[4fca1db] | 704 | if ! make helloworld > /dev/null 2>&1; then |
---|
| 705 | echo "WARNING: Your version of make (BSD make?) does not support BitlBee's makefiles." |
---|
| 706 | echo "BitlBee needs GNU make to build properly. On most systems GNU make is available" |
---|
| 707 | echo "under the name 'gmake'." |
---|
| 708 | echo |
---|
| 709 | if gmake helloworld > /dev/null 2>&1; then |
---|
| 710 | echo "gmake seems to be available on your machine, great." |
---|
| 711 | echo |
---|
| 712 | else |
---|
| 713 | echo "gmake is not installed (or not working). Please try to install it." |
---|
| 714 | echo |
---|
| 715 | fi |
---|
| 716 | fi |
---|
| 717 | |
---|
[b95b0c8] | 718 | cat <<EOF >bitlbee.pc |
---|
[e506d6c] | 719 | prefix=$prefix |
---|
| 720 | includedir=$includedir |
---|
[489847f] | 721 | plugindir=$plugindir |
---|
[e506d6c] | 722 | |
---|
| 723 | Name: bitlbee |
---|
| 724 | Description: IRC to IM gateway |
---|
| 725 | Requires: glib-2.0 |
---|
| 726 | Version: $BITLBEE_VERSION |
---|
| 727 | Libs: |
---|
| 728 | Cflags: -I\${includedir} |
---|
| 729 | |
---|
| 730 | EOF |
---|
| 731 | |
---|
[b7d3cc34] | 732 | protocols='' |
---|
| 733 | protoobjs='' |
---|
| 734 | |
---|
[e248c7f] | 735 | if [ "$purple" = 0 ]; then |
---|
| 736 | echo '#undef WITH_PURPLE' >> config.h |
---|
| 737 | else |
---|
[e08e53c] | 738 | if ! $PKG_CONFIG purple; then |
---|
| 739 | echo |
---|
| 740 | echo 'Cannot find libpurple development libraries, aborting. (Install libpurple-dev?)' |
---|
| 741 | exit 1 |
---|
| 742 | fi |
---|
[e248c7f] | 743 | echo '#define WITH_PURPLE' >> config.h |
---|
[b95b0c8] | 744 | cat<<EOF >>Makefile.settings |
---|
[e08e53c] | 745 | EFLAGS += $($PKG_CONFIG purple --libs) |
---|
| 746 | PURPLE_CFLAGS += $($PKG_CONFIG purple --cflags) |
---|
| 747 | EOF |
---|
[e248c7f] | 748 | protocols=$protocols'purple ' |
---|
| 749 | protoobjs=$protoobjs'purple_mod.o ' |
---|
| 750 | |
---|
[04e2a05] | 751 | # only disable these if the user didn't enable them explicitly |
---|
| 752 | [ "$msn" = "default-on" ] && msn=0 |
---|
| 753 | [ "$jabber" = "default-on" ] && jabber=0 |
---|
| 754 | [ "$oscar" = "default-on" ] && oscar=0 |
---|
| 755 | [ "$yahoo" = "default-on" ] && yahoo=0 |
---|
[18e1f3b] | 756 | |
---|
| 757 | echo '#undef PACKAGE' >> config.h |
---|
| 758 | echo '#define PACKAGE "BitlBee-LIBPURPLE"' >> config.h |
---|
[bda2975] | 759 | |
---|
| 760 | if [ "$events" = "libevent" ]; then |
---|
| 761 | echo 'Warning: Some libpurple modules (including msn-pecan) do their event handling' |
---|
| 762 | echo 'outside libpurple, talking to GLib directly. At least for now the combination' |
---|
| 763 | echo 'libpurple + libevent is *not* recommended!' |
---|
[c775a58] | 764 | echo |
---|
[bda2975] | 765 | fi |
---|
[e248c7f] | 766 | fi |
---|
| 767 | |
---|
[b0a89cc] | 768 | case "$CC" in |
---|
| 769 | *gcc* ) |
---|
[e371011] | 770 | echo CFLAGS+=-MMD -MF .depend/\$@.d >> Makefile.settings |
---|
[fe92921] | 771 | for i in . lib tests protocols protocols/*/; do |
---|
[b0a89cc] | 772 | mkdir -p $i/.depend |
---|
| 773 | done |
---|
| 774 | esac |
---|
| 775 | |
---|
[b7d3cc34] | 776 | if [ "$msn" = 0 ]; then |
---|
| 777 | echo '#undef WITH_MSN' >> config.h |
---|
| 778 | else |
---|
| 779 | echo '#define WITH_MSN' >> config.h |
---|
| 780 | protocols=$protocols'msn ' |
---|
[b5a22e3] | 781 | protoobjs=$protoobjs'msn_mod.o ' |
---|
[b7d3cc34] | 782 | fi |
---|
| 783 | |
---|
| 784 | if [ "$jabber" = 0 ]; then |
---|
| 785 | echo '#undef WITH_JABBER' >> config.h |
---|
| 786 | else |
---|
| 787 | echo '#define WITH_JABBER' >> config.h |
---|
| 788 | protocols=$protocols'jabber ' |
---|
[b5a22e3] | 789 | protoobjs=$protoobjs'jabber_mod.o ' |
---|
[b7d3cc34] | 790 | fi |
---|
| 791 | |
---|
| 792 | if [ "$oscar" = 0 ]; then |
---|
| 793 | echo '#undef WITH_OSCAR' >> config.h |
---|
| 794 | else |
---|
| 795 | echo '#define WITH_OSCAR' >> config.h |
---|
| 796 | protocols=$protocols'oscar ' |
---|
[b5a22e3] | 797 | protoobjs=$protoobjs'oscar_mod.o ' |
---|
[b7d3cc34] | 798 | fi |
---|
| 799 | |
---|
| 800 | if [ "$yahoo" = 0 ]; then |
---|
| 801 | echo '#undef WITH_YAHOO' >> config.h |
---|
| 802 | else |
---|
| 803 | echo '#define WITH_YAHOO' >> config.h |
---|
| 804 | protocols=$protocols'yahoo ' |
---|
[b5a22e3] | 805 | protoobjs=$protoobjs'yahoo_mod.o ' |
---|
[b7d3cc34] | 806 | fi |
---|
| 807 | |
---|
[1b221e0] | 808 | if [ "$twitter" = 0 ]; then |
---|
| 809 | echo '#undef WITH_TWITTER' >> config.h |
---|
| 810 | else |
---|
| 811 | echo '#define WITH_TWITTER' >> config.h |
---|
| 812 | protocols=$protocols'twitter ' |
---|
| 813 | protoobjs=$protoobjs'twitter_mod.o ' |
---|
| 814 | fi |
---|
| 815 | |
---|
[b7d3cc34] | 816 | if [ "$protocols" = "PROTOCOLS = " ]; then |
---|
[43462708] | 817 | echo "Warning: You haven't selected any communication protocol to compile!" |
---|
[b3c467b] | 818 | echo " BitlBee will run, but you will be unable to connect to IM servers!" |
---|
[b7d3cc34] | 819 | fi |
---|
| 820 | |
---|
| 821 | echo "PROTOCOLS = $protocols" >> Makefile.settings |
---|
| 822 | echo "PROTOOBJS = $protoobjs" >> Makefile.settings |
---|
| 823 | |
---|
| 824 | echo Architecture: $arch |
---|
| 825 | case "$arch" in |
---|
| 826 | Linux ) |
---|
| 827 | ;; |
---|
| 828 | GNU/* ) |
---|
| 829 | ;; |
---|
| 830 | *BSD ) |
---|
| 831 | ;; |
---|
| 832 | Darwin ) |
---|
[caceb06] | 833 | echo 'STRIP=\# skip strip' >> Makefile.settings |
---|
[b7d3cc34] | 834 | ;; |
---|
| 835 | IRIX ) |
---|
| 836 | ;; |
---|
| 837 | SunOS ) |
---|
| 838 | echo 'EFLAGS+=-lresolv -lnsl -lsocket' >> Makefile.settings |
---|
| 839 | echo 'STRIP=\# skip strip' >> Makefile.settings |
---|
[70d7795] | 840 | echo '#define NO_FD_PASSING' >> config.h |
---|
[b7d3cc34] | 841 | ;; |
---|
[8de63c3] | 842 | AIX ) |
---|
| 843 | echo 'EFLAGS+=-Wl,-brtl' >> Makefile.settings |
---|
[b7d3cc34] | 844 | ;; |
---|
| 845 | CYGWIN* ) |
---|
| 846 | ;; |
---|
[aec56b0] | 847 | Windows ) |
---|
[e252d8c] | 848 | echo 'Native windows compilation is not supported anymore, use cygwin instead.' |
---|
[aec56b0] | 849 | ;; |
---|
[b7d3cc34] | 850 | * ) |
---|
[8d6c4b1] | 851 | echo 'We haven'\''t tested BitlBee on many platforms yet, yours is untested. YMMV.' |
---|
| 852 | echo 'Please report any problems at http://bugs.bitlbee.org/.' |
---|
[b7d3cc34] | 853 | ;; |
---|
| 854 | esac |
---|
| 855 | |
---|
[f1e7407] | 856 | if [ -n "$target" ]; then |
---|
| 857 | echo "Cross-compiling for: $target" |
---|
| 858 | fi |
---|
| 859 | |
---|
[b7d3cc34] | 860 | echo |
---|
| 861 | echo 'Configuration done:' |
---|
| 862 | |
---|
| 863 | if [ "$debug" = "1" ]; then |
---|
[b3c467b] | 864 | echo ' Debugging enabled.' |
---|
[b7d3cc34] | 865 | else |
---|
[b3c467b] | 866 | echo ' Debugging disabled.' |
---|
[b7d3cc34] | 867 | fi |
---|
| 868 | |
---|
[e2472dd] | 869 | if [ "$asan" = "1" ]; then |
---|
| 870 | echo ' AddressSanitizer (ASAN) enabled.' |
---|
| 871 | else |
---|
| 872 | echo ' AddressSanitizer (ASAN) disabled.' |
---|
| 873 | fi |
---|
| 874 | |
---|
[7281ad1] | 875 | if [ "$pie" = "1" ]; then |
---|
| 876 | echo ' Building PIE executable' |
---|
| 877 | else |
---|
| 878 | echo ' Building non-PIE executable' |
---|
| 879 | fi |
---|
| 880 | |
---|
[b7d3cc34] | 881 | if [ "$strip" = "1" ]; then |
---|
[b3c467b] | 882 | echo ' Binary stripping enabled.' |
---|
[b7d3cc34] | 883 | else |
---|
[b3c467b] | 884 | echo ' Binary stripping disabled.' |
---|
[b7d3cc34] | 885 | fi |
---|
| 886 | |
---|
[764c7d1] | 887 | if [ "$otr" = "1" ]; then |
---|
| 888 | echo ' Off-the-Record (OTR) Messaging enabled.' |
---|
[858ea01] | 889 | elif [ "$otr" = "plugin" ]; then |
---|
| 890 | echo ' Off-the-Record (OTR) Messaging enabled (as a plugin).' |
---|
[764c7d1] | 891 | else |
---|
| 892 | echo ' Off-the-Record (OTR) Messaging disabled.' |
---|
| 893 | fi |
---|
| 894 | |
---|
[417002e] | 895 | if [ -n "$systemdsystemunitdir" ]; then |
---|
| 896 | echo ' systemd enabled.' |
---|
| 897 | else |
---|
| 898 | echo ' systemd disabled.' |
---|
| 899 | fi |
---|
| 900 | |
---|
[b3c467b] | 901 | echo ' Using event handler: '$events |
---|
| 902 | echo ' Using SSL library: '$ssl |
---|
[4e3df8a] | 903 | #echo ' Building with these storage backends: '$STORAGES |
---|
[b7d3cc34] | 904 | |
---|
| 905 | if [ -n "$protocols" ]; then |
---|
[17f6079] | 906 | echo ' Building with these protocols:' $protocols$protocols_mods |
---|
[4e3df8a] | 907 | case "$protocols" in |
---|
| 908 | *purple*) |
---|
| 909 | echo " Note that BitlBee-libpurple is supported on a best-effort basis. It's" |
---|
| 910 | echo " not *fully* compatible with normal BitlBee. Don't use it unless you" |
---|
| 911 | echo " absolutely need it (i.e. support for a certain protocol or feature)." |
---|
| 912 | esac |
---|
[b7d3cc34] | 913 | else |
---|
[b3c467b] | 914 | echo ' Building without IM-protocol support. We wish you a lot of fun...' |
---|
[b7d3cc34] | 915 | fi |
---|