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