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