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