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