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