[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/' |
---|
| 11 | bindir='$prefix/sbin/' |
---|
| 12 | etcdir='$prefix/etc/bitlbee/' |
---|
| 13 | mandir='$prefix/share/man/' |
---|
| 14 | datadir='$prefix/share/bitlbee/' |
---|
| 15 | config='/var/lib/bitlbee/' |
---|
[85cf37f] | 16 | plugindir='$prefix/lib/bitlbee/' |
---|
| 17 | includedir='$prefix/include/bitlbee/' |
---|
| 18 | libevent='/usr/' |
---|
[34b17d9] | 19 | pidfile='/var/run/bitlbee.pid' |
---|
[5c5a586] | 20 | ipcsocket='/var/run/bitlbee.sock' |
---|
[e506d6c] | 21 | pcdir='$prefix/lib/pkgconfig' |
---|
[b7d3cc34] | 22 | |
---|
| 23 | msn=1 |
---|
| 24 | jabber=1 |
---|
| 25 | oscar=1 |
---|
| 26 | yahoo=1 |
---|
| 27 | |
---|
| 28 | debug=0 |
---|
| 29 | strip=1 |
---|
[66b9e86e] | 30 | gcov=0 |
---|
[2abfbc5] | 31 | plugins=1 |
---|
[764c7d1] | 32 | otr=auto |
---|
[85cf37f] | 33 | |
---|
| 34 | events=glib |
---|
[670204f] | 35 | ldap=0 |
---|
[b7d3cc34] | 36 | ssl=auto |
---|
| 37 | |
---|
| 38 | arch=`uname -s` |
---|
| 39 | cpu=`uname -m` |
---|
| 40 | |
---|
[670204f] | 41 | GLIB_MIN_VERSION=2.4 |
---|
| 42 | |
---|
[b7d3cc34] | 43 | echo BitlBee configure |
---|
| 44 | |
---|
| 45 | while [ -n "$1" ]; do |
---|
| 46 | e="`expr "X$1" : 'X--\(.*=.*\)'`" |
---|
| 47 | if [ -z "$e" ]; then |
---|
| 48 | cat<<EOF |
---|
| 49 | |
---|
| 50 | Usage: $0 [OPTIONS] |
---|
| 51 | |
---|
| 52 | Option Description Default |
---|
| 53 | |
---|
| 54 | --prefix=... Directories to put files in $prefix |
---|
| 55 | --bindir=... $bindir |
---|
| 56 | --etcdir=... $etcdir |
---|
| 57 | --mandir=... $mandir |
---|
| 58 | --datadir=... $datadir |
---|
[7b23afd] | 59 | --plugindir=... $plugindir |
---|
[34b17d9] | 60 | --pidfile=... $pidfile |
---|
[b7d3cc34] | 61 | --config=... $config |
---|
[6dff9d4] | 62 | --ipcsocket=... $ipcsocket |
---|
[b7d3cc34] | 63 | |
---|
| 64 | --msn=0/1 Disable/enable MSN part $msn |
---|
| 65 | --jabber=0/1 Disable/enable Jabber part $jabber |
---|
| 66 | --oscar=0/1 Disable/enable Oscar part (ICQ, AIM) $oscar |
---|
| 67 | --yahoo=0/1 Disable/enable Yahoo part $yahoo |
---|
| 68 | |
---|
| 69 | --debug=0/1 Disable/enable debugging $debug |
---|
| 70 | --strip=0/1 Disable/enable binary stripping $strip |
---|
[66b9e86e] | 71 | --gcov=0/1 Disable/enable test coverage reporting $gcov |
---|
[2abfbc5] | 72 | --plugins=0/1 Disable/enable plugins support $plugins |
---|
[764c7d1] | 73 | --otr=0/1/auto Disable/enable OTR encryption support $otr |
---|
[b7d3cc34] | 74 | |
---|
[85cf37f] | 75 | --events=... Event handler (glib, libevent) $events |
---|
[b7d3cc34] | 76 | --ssl=... SSL library to use (gnutls, nss, openssl, bogus, auto) |
---|
| 77 | $ssl |
---|
| 78 | EOF |
---|
| 79 | exit; |
---|
| 80 | fi |
---|
| 81 | eval "$e" |
---|
| 82 | shift; |
---|
| 83 | done |
---|
| 84 | |
---|
| 85 | # Expand $prefix and get rid of double slashes |
---|
| 86 | bindir=`eval echo "$bindir/" | sed 's/\/\{1,\}/\//g'` |
---|
| 87 | etcdir=`eval echo "$etcdir/" | sed 's/\/\{1,\}/\//g'` |
---|
| 88 | mandir=`eval echo "$mandir/" | sed 's/\/\{1,\}/\//g'` |
---|
| 89 | datadir=`eval echo "$datadir/" | sed 's/\/\{1,\}/\//g'` |
---|
| 90 | config=`eval echo "$config/" | sed 's/\/\{1,\}/\//g'` |
---|
[7b23afd] | 91 | plugindir=`eval echo "$plugindir/" | sed 's/\/\{1,\}/\//g'` |
---|
[85cf37f] | 92 | includedir=`eval echo "$includedir"/ | sed 's/\/\{1,\}/\//g'` |
---|
| 93 | libevent=`eval echo "$libevent"/ | sed 's/\/\{1,\}/\//g'` |
---|
| 94 | |
---|
[6dff9d4] | 95 | pidfile=`eval echo "$pidfile" | sed 's/\/\{1,\}/\//g'` |
---|
| 96 | ipcsocket=`eval echo "$ipcsocket" | sed 's/\/\{1,\}/\//g'` |
---|
[e506d6c] | 97 | pcdir=`eval echo "$pcdir" | sed 's/\/\{1,\}/\//g'` |
---|
[b7d3cc34] | 98 | |
---|
| 99 | cat<<EOF>Makefile.settings |
---|
| 100 | ## BitlBee settings, generated by configure |
---|
| 101 | PREFIX=$prefix |
---|
| 102 | BINDIR=$bindir |
---|
| 103 | ETCDIR=$etcdir |
---|
| 104 | MANDIR=$mandir |
---|
| 105 | DATADIR=$datadir |
---|
[7b23afd] | 106 | PLUGINDIR=$plugindir |
---|
[b7d3cc34] | 107 | CONFIG=$config |
---|
[e506d6c] | 108 | INCLUDEDIR=$includedir |
---|
| 109 | PCDIR=$pcdir |
---|
[b7d3cc34] | 110 | |
---|
| 111 | ARCH=$arch |
---|
| 112 | CPU=$cpu |
---|
| 113 | OUTFILE=bitlbee |
---|
| 114 | |
---|
| 115 | DESTDIR= |
---|
| 116 | LFLAGS= |
---|
| 117 | EFLAGS= |
---|
| 118 | EOF |
---|
| 119 | |
---|
| 120 | cat<<EOF>config.h |
---|
| 121 | /* BitlBee settings, generated by configure |
---|
| 122 | |
---|
| 123 | Do *NOT* use any of these defines in your code without thinking twice, most |
---|
| 124 | of them can/will be overridden at run-time */ |
---|
| 125 | |
---|
| 126 | #define CONFIG "$config" |
---|
| 127 | #define ETCDIR "$etcdir" |
---|
| 128 | #define VARDIR "$datadir" |
---|
[7b23afd] | 129 | #define PLUGINDIR "$plugindir" |
---|
[34b17d9] | 130 | #define PIDFILE "$pidfile" |
---|
[6dff9d4] | 131 | #define IPCSOCKET "$ipcsocket" |
---|
[b7d3cc34] | 132 | #define ARCH "$arch" |
---|
| 133 | #define CPU "$cpu" |
---|
| 134 | EOF |
---|
| 135 | |
---|
| 136 | if [ "$debug" = "1" ]; then |
---|
[285b55d] | 137 | [ -z "$CFLAGS" ] && CFLAGS=-g |
---|
[b7d3cc34] | 138 | echo 'DEBUG=1' >> Makefile.settings |
---|
[911cc4f] | 139 | CFLAGS="$CFLAGS -DDEBUG" |
---|
[b7d3cc34] | 140 | else |
---|
[56f260a] | 141 | [ -z "$CFLAGS" ] && CFLAGS="-O2 -fno-strict-aliasing" |
---|
[b7d3cc34] | 142 | fi |
---|
| 143 | |
---|
[285b55d] | 144 | echo CFLAGS=$CFLAGS >> Makefile.settings |
---|
[df1694b] | 145 | echo CFLAGS+=-I`pwd` -I`pwd`/lib -I`pwd`/protocols -I. >> Makefile.settings |
---|
[b7d3cc34] | 146 | |
---|
[f712188] | 147 | echo CFLAGS+=-DHAVE_CONFIG_H >> Makefile.settings |
---|
| 148 | |
---|
[b7d3cc34] | 149 | if [ -n "$CC" ]; then |
---|
[5973412] | 150 | CC=$CC |
---|
[b7d3cc34] | 151 | elif type gcc > /dev/null 2> /dev/null; then |
---|
[5973412] | 152 | CC=gcc |
---|
[b7d3cc34] | 153 | elif type cc > /dev/null 2> /dev/null; then |
---|
[5973412] | 154 | CC=cc |
---|
[b7d3cc34] | 155 | else |
---|
| 156 | echo 'Cannot find a C compiler, aborting.' |
---|
| 157 | exit 1; |
---|
| 158 | fi |
---|
| 159 | |
---|
[5973412] | 160 | echo "CC=$CC" >> Makefile.settings; |
---|
| 161 | |
---|
[b7d3cc34] | 162 | if [ -n "$LD" ]; then |
---|
| 163 | echo "LD=$LD" >> Makefile.settings; |
---|
| 164 | elif type ld > /dev/null 2> /dev/null; then |
---|
| 165 | echo "LD=ld" >> Makefile.settings; |
---|
| 166 | else |
---|
| 167 | echo 'Cannot find ld, aborting.' |
---|
| 168 | exit 1; |
---|
| 169 | fi |
---|
| 170 | |
---|
[32c632f] | 171 | if [ -z "$PKG_CONFIG" ]; then |
---|
| 172 | PKG_CONFIG=pkg-config |
---|
| 173 | fi |
---|
| 174 | |
---|
| 175 | if $PKG_CONFIG --version > /dev/null 2>/dev/null && $PKG_CONFIG glib-2.0; then |
---|
[670204f] | 176 | if $PKG_CONFIG glib-2.0 --atleast-version=$GLIB_MIN_VERSION; then |
---|
| 177 | cat<<EOF>>Makefile.settings |
---|
[764c7d1] | 178 | EFLAGS+=`$PKG_CONFIG --libs glib-2.0 gmodule-2.0 gthread-2.0` |
---|
| 179 | CFLAGS+=`$PKG_CONFIG --cflags glib-2.0 gmodule-2.0 gthread-2.0` |
---|
[b7d3cc34] | 180 | EOF |
---|
[670204f] | 181 | else |
---|
| 182 | echo |
---|
| 183 | echo 'Found glib2 '`$PKG_CONFIG glib-2.0 --modversion`', but version '$GLIB_MIN_VERSION' or newer is required.' |
---|
| 184 | exit 1 |
---|
| 185 | fi |
---|
[b7d3cc34] | 186 | else |
---|
[670204f] | 187 | echo |
---|
[574af7e] | 188 | echo 'Cannot find glib2 development libraries, aborting. (Install libglib2-dev?)' |
---|
[670204f] | 189 | exit 1 |
---|
[b7d3cc34] | 190 | fi |
---|
| 191 | |
---|
[85cf37f] | 192 | if [ "$events" = "libevent" ]; then |
---|
[003553b] | 193 | if ! [ -f "${libevent}include/event.h" ]; then |
---|
[85cf37f] | 194 | echo |
---|
| 195 | echo 'Warning: Could not find event.h, you might have to install it and/or specify' |
---|
| 196 | echo 'its location using the --libevent= argument. (Example: If event.h is in' |
---|
| 197 | echo '/usr/local/include and binaries are in /usr/local/lib: --libevent=/usr/local)' |
---|
| 198 | fi |
---|
| 199 | |
---|
| 200 | echo '#define EVENTS_LIBEVENT' >> config.h |
---|
| 201 | cat <<EOF>>Makefile.settings |
---|
| 202 | EFLAGS+=-levent -L${libevent}lib |
---|
| 203 | CFLAGS+=-I${libevent}include |
---|
| 204 | EOF |
---|
| 205 | elif [ "$events" = "glib" ]; then |
---|
| 206 | ## We already use glib anyway, so this is all we need (and in fact not even this, but just to be sure...): |
---|
| 207 | echo '#define EVENTS_GLIB' >> config.h |
---|
| 208 | else |
---|
| 209 | echo |
---|
| 210 | echo 'ERROR: Unknown event handler specified.' |
---|
| 211 | exit 1 |
---|
[b7d3cc34] | 212 | fi |
---|
[85cf37f] | 213 | echo 'EVENT_HANDLER=events_'$events'.o' >> Makefile.settings |
---|
[b7d3cc34] | 214 | |
---|
| 215 | detect_gnutls() |
---|
| 216 | { |
---|
| 217 | if libgnutls-config --version > /dev/null 2> /dev/null; then |
---|
| 218 | cat <<EOF>>Makefile.settings |
---|
| 219 | EFLAGS+=`libgnutls-config --libs` |
---|
| 220 | CFLAGS+=`libgnutls-config --cflags` |
---|
| 221 | EOF |
---|
| 222 | |
---|
| 223 | ssl=gnutls |
---|
| 224 | ret=1; |
---|
| 225 | else |
---|
| 226 | ret=0; |
---|
| 227 | fi; |
---|
| 228 | } |
---|
| 229 | |
---|
| 230 | detect_nss() |
---|
| 231 | { |
---|
[32c632f] | 232 | if $PKG_CONFIG --version > /dev/null 2>/dev/null && $PKG_CONFIG mozilla-nss; then |
---|
[b7d3cc34] | 233 | cat<<EOF>>Makefile.settings |
---|
[32c632f] | 234 | EFLAGS+=`$PKG_CONFIG --libs mozilla-nss` |
---|
| 235 | CFLAGS+=`$PKG_CONFIG --cflags mozilla-nss` |
---|
[b7d3cc34] | 236 | EOF |
---|
| 237 | |
---|
| 238 | ssl=nss |
---|
| 239 | ret=1; |
---|
| 240 | else |
---|
| 241 | ret=0; |
---|
| 242 | fi; |
---|
| 243 | } |
---|
| 244 | |
---|
[f32d557] | 245 | detect_ldap() |
---|
[f665dab] | 246 | { |
---|
[5973412] | 247 | TMPFILE=`mktemp` |
---|
| 248 | if $CC -o $TMPFILE -shared -lldap 2>/dev/null >/dev/null; then |
---|
[f665dab] | 249 | cat<<EOF>>Makefile.settings |
---|
[5973412] | 250 | EFLAGS+=-lldap |
---|
| 251 | CFLAGS+= |
---|
[f665dab] | 252 | EOF |
---|
[f32d557] | 253 | ldap=1 |
---|
[5973412] | 254 | rm -f $TMPFILE |
---|
[f665dab] | 255 | ret=1 |
---|
[b7d3cc34] | 256 | else |
---|
[5973412] | 257 | ldap=0 |
---|
[f665dab] | 258 | ret=0 |
---|
[b7d3cc34] | 259 | fi |
---|
[f665dab] | 260 | } |
---|
| 261 | |
---|
[b3c467b] | 262 | if [ "$ssl" = "auto" ]; then |
---|
| 263 | detect_gnutls |
---|
[b7d3cc34] | 264 | if [ "$ret" = "0" ]; then |
---|
[b3c467b] | 265 | detect_nss |
---|
[b7d3cc34] | 266 | fi |
---|
[b3c467b] | 267 | elif [ "$ssl" = "gnutls" ]; then |
---|
| 268 | detect_gnutls |
---|
| 269 | elif [ "$ssl" = "nss" ]; then |
---|
| 270 | detect_nss |
---|
| 271 | elif [ "$ssl" = "openssl" ]; then |
---|
| 272 | echo |
---|
| 273 | echo 'No detection code exists for OpenSSL. Make sure that you have a complete' |
---|
| 274 | echo 'install of OpenSSL (including devel/header files) before reporting' |
---|
| 275 | echo 'compilation problems.' |
---|
| 276 | echo |
---|
| 277 | echo 'Also, keep in mind that the OpenSSL is, according to some people, not' |
---|
| 278 | echo 'completely GPL-compatible. Using GnuTLS or NSS is recommended and better' |
---|
| 279 | echo 'supported by us. However, on many BSD machines, OpenSSL can be considered' |
---|
| 280 | echo 'part of the operating system, which makes it GPL-compatible.' |
---|
| 281 | echo |
---|
| 282 | echo 'For more info, see: http://www.openssl.org/support/faq.html#LEGAL2' |
---|
| 283 | echo ' http://www.gnome.org/~markmc/openssl-and-the-gpl.html' |
---|
| 284 | echo |
---|
| 285 | echo 'Please note that distributing a BitlBee binary which links to OpenSSL is' |
---|
| 286 | echo 'probably illegal. If you want to create and distribute a binary BitlBee' |
---|
| 287 | echo 'package, you really should use GnuTLS or NSS instead.' |
---|
| 288 | echo |
---|
| 289 | echo 'Also, the OpenSSL license requires us to say this:' |
---|
| 290 | echo ' * "This product includes software developed by the OpenSSL Project' |
---|
| 291 | echo ' * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"' |
---|
[b7d3cc34] | 292 | |
---|
[b3c467b] | 293 | echo 'EFLAGS+=-lssl -lcrypto' >> Makefile.settings |
---|
| 294 | |
---|
| 295 | ret=1 |
---|
| 296 | elif [ "$ssl" = "bogus" ]; then |
---|
| 297 | echo |
---|
[670204f] | 298 | echo 'Using bogus SSL code. This means some features will not work properly.' |
---|
[b3c467b] | 299 | |
---|
| 300 | ## Yes, you, at the console! How can you authenticate if you don't have any SSL!? |
---|
| 301 | if [ "$msn" = "1" ]; then |
---|
[b7d3cc34] | 302 | echo |
---|
[b3c467b] | 303 | echo 'Real SSL support is necessary for MSN authentication, will build without' |
---|
| 304 | echo 'MSN protocol support.' |
---|
| 305 | msn=0 |
---|
| 306 | fi |
---|
[b7d3cc34] | 307 | |
---|
[b3c467b] | 308 | ret=1 |
---|
| 309 | else |
---|
| 310 | echo |
---|
| 311 | echo 'ERROR: Unknown SSL library specified.' |
---|
| 312 | exit 1 |
---|
[b7d3cc34] | 313 | fi |
---|
| 314 | |
---|
[b3c467b] | 315 | if [ "$ret" = "0" ]; then |
---|
| 316 | echo |
---|
| 317 | echo 'ERROR: Could not find a suitable SSL library (GnuTLS, libnss or OpenSSL).' |
---|
| 318 | echo ' Please note that this script doesn'\''t have detection code for OpenSSL,' |
---|
| 319 | echo ' so if you want to use that, you have to select it by hand. If you don'\''t' |
---|
| 320 | echo ' need SSL support, you can select the "bogus" SSL library. (--ssl=bogus)' |
---|
[b7d3cc34] | 321 | |
---|
[b3c467b] | 322 | exit 1 |
---|
| 323 | fi; |
---|
| 324 | |
---|
| 325 | echo 'SSL_CLIENT=ssl_'$ssl'.o' >> Makefile.settings |
---|
| 326 | |
---|
[36e9f62] | 327 | for i in /lib /usr/lib /usr/local/lib; do |
---|
[003553b] | 328 | if [ -f $i/libresolv.a ]; then |
---|
[36e9f62] | 329 | echo '#define HAVE_RESOLV_A' >> config.h |
---|
| 330 | echo 'EFLAGS+='$i'/libresolv.a' >> Makefile.settings |
---|
| 331 | break |
---|
| 332 | fi |
---|
| 333 | done |
---|
| 334 | |
---|
[b3c467b] | 335 | STORAGES="text xml" |
---|
| 336 | |
---|
[f32d557] | 337 | if [ "$ldap" = "auto" ]; then |
---|
| 338 | detect_ldap |
---|
[f665dab] | 339 | fi |
---|
| 340 | |
---|
[f32d557] | 341 | if [ "$ldap" = 0 ]; then |
---|
[5973412] | 342 | echo "#undef WITH_LDAP" >> config.h |
---|
[f32d557] | 343 | elif [ "$ldap" = 1 ]; then |
---|
[5c5a586] | 344 | echo |
---|
| 345 | echo 'LDAP support is a work in progress and does NOT work AT ALL right now.' |
---|
| 346 | echo |
---|
| 347 | exit 1 |
---|
| 348 | |
---|
[5973412] | 349 | echo "#define WITH_LDAP 1" >> config.h |
---|
[b3c467b] | 350 | STORAGES="$STORAGES ldap" |
---|
[b7d3cc34] | 351 | fi |
---|
| 352 | |
---|
[b3c467b] | 353 | for i in $STORAGES; do |
---|
| 354 | STORAGE_OBJS="$STORAGE_OBJS storage_$i.o" |
---|
| 355 | done |
---|
| 356 | echo "STORAGE_OBJS="$STORAGE_OBJS >> Makefile.settings |
---|
| 357 | |
---|
[b7d3cc34] | 358 | if [ "$strip" = 0 ]; then |
---|
| 359 | echo "STRIP=\# skip strip" >> Makefile.settings; |
---|
| 360 | else |
---|
| 361 | if [ "$debug" = 1 ]; then |
---|
| 362 | echo |
---|
| 363 | echo 'Stripping binaries does not make sense when debugging. Stripping disabled.' |
---|
| 364 | echo 'STRIP=\# skip strip' >> Makefile.settings |
---|
| 365 | strip=0; |
---|
| 366 | elif [ -n "$STRIP" ]; then |
---|
| 367 | echo "STRIP=$STRIP" >> Makefile.settings; |
---|
| 368 | elif type strip > /dev/null 2> /dev/null; then |
---|
| 369 | echo "STRIP=strip" >> Makefile.settings; |
---|
| 370 | else |
---|
| 371 | echo |
---|
| 372 | echo 'No strip utility found, cannot remove unnecessary parts from executable.' |
---|
| 373 | echo 'STRIP=\# skip strip' >> Makefile.settings |
---|
| 374 | strip=0; |
---|
| 375 | fi; |
---|
| 376 | fi |
---|
| 377 | |
---|
[66b9e86e] | 378 | if [ "$gcov" = "1" ]; then |
---|
| 379 | echo "CFLAGS+=-ftest-coverage -fprofile-arcs" >> Makefile.settings |
---|
| 380 | echo "EFLAGS+=-lgcov" >> Makefile.settings |
---|
| 381 | fi |
---|
| 382 | |
---|
[2abfbc5] | 383 | if [ "$plugins" = 0 ]; then |
---|
| 384 | echo '#undef WITH_PLUGINS' >> config.h |
---|
| 385 | else |
---|
| 386 | echo '#define WITH_PLUGINS' >> config.h |
---|
| 387 | fi |
---|
| 388 | |
---|
[764c7d1] | 389 | if [ "$otr" = "auto" ]; then |
---|
| 390 | for i in /lib /usr/lib /usr/local/lib; do |
---|
| 391 | if [ -f $i/libotr.a ]; then |
---|
| 392 | otr=1 |
---|
| 393 | break |
---|
| 394 | fi |
---|
| 395 | done |
---|
| 396 | fi |
---|
| 397 | if [ "$otr" = 0 ]; then |
---|
| 398 | echo '#undef WITH_OTR' >> config.h |
---|
| 399 | else |
---|
| 400 | echo '#define WITH_OTR' >> config.h |
---|
| 401 | echo "EFLAGS+=-lotr" >> Makefile.settings |
---|
| 402 | fi |
---|
| 403 | |
---|
[ffea9b9] | 404 | echo |
---|
[a014331] | 405 | if [ -z "$BITLBEE_VERSION" -a -d .bzr ] && type bzr > /dev/null 2> /dev/null; then |
---|
| 406 | nick=`bzr nick` |
---|
| 407 | if [ -n "$nick" -a "$nick" != "bitlbee" ]; then |
---|
| 408 | nick="-$nick" |
---|
| 409 | else |
---|
| 410 | nick="" |
---|
| 411 | fi |
---|
[ffea9b9] | 412 | rev=`bzr revno` |
---|
| 413 | echo 'Using bzr revision #'$rev' as version number' |
---|
[a014331] | 414 | BITLBEE_VERSION=\"bzr$nick-$rev\" |
---|
[ffea9b9] | 415 | fi |
---|
| 416 | |
---|
[b7d3cc34] | 417 | if [ -n "$BITLBEE_VERSION" ]; then |
---|
| 418 | echo 'Spoofing version number: '$BITLBEE_VERSION |
---|
| 419 | echo '#undef BITLBEE_VERSION' >> config.h |
---|
[ffea9b9] | 420 | echo '#define BITLBEE_VERSION '$BITLBEE_VERSION >> config.h |
---|
| 421 | echo |
---|
[b7d3cc34] | 422 | fi |
---|
| 423 | |
---|
[e506d6c] | 424 | cat <<EOF>bitlbee.pc |
---|
| 425 | prefix=$prefix |
---|
| 426 | includedir=$includedir |
---|
| 427 | |
---|
| 428 | Name: bitlbee |
---|
| 429 | Description: IRC to IM gateway |
---|
| 430 | Requires: glib-2.0 |
---|
| 431 | Version: $BITLBEE_VERSION |
---|
| 432 | Libs: |
---|
| 433 | Cflags: -I\${includedir} |
---|
| 434 | |
---|
| 435 | EOF |
---|
| 436 | |
---|
[b7d3cc34] | 437 | protocols='' |
---|
| 438 | protoobjs='' |
---|
| 439 | |
---|
| 440 | if [ "$msn" = 0 ]; then |
---|
| 441 | echo '#undef WITH_MSN' >> config.h |
---|
| 442 | else |
---|
| 443 | echo '#define WITH_MSN' >> config.h |
---|
| 444 | protocols=$protocols'msn ' |
---|
[b5a22e3] | 445 | protoobjs=$protoobjs'msn_mod.o ' |
---|
[b7d3cc34] | 446 | fi |
---|
| 447 | |
---|
| 448 | if [ "$jabber" = 0 ]; then |
---|
| 449 | echo '#undef WITH_JABBER' >> config.h |
---|
| 450 | else |
---|
| 451 | echo '#define WITH_JABBER' >> config.h |
---|
| 452 | protocols=$protocols'jabber ' |
---|
[b5a22e3] | 453 | protoobjs=$protoobjs'jabber_mod.o ' |
---|
[b7d3cc34] | 454 | fi |
---|
| 455 | |
---|
| 456 | if [ "$oscar" = 0 ]; then |
---|
| 457 | echo '#undef WITH_OSCAR' >> config.h |
---|
| 458 | else |
---|
| 459 | echo '#define WITH_OSCAR' >> config.h |
---|
| 460 | protocols=$protocols'oscar ' |
---|
[b5a22e3] | 461 | protoobjs=$protoobjs'oscar_mod.o ' |
---|
[b7d3cc34] | 462 | fi |
---|
| 463 | |
---|
| 464 | if [ "$yahoo" = 0 ]; then |
---|
| 465 | echo '#undef WITH_YAHOO' >> config.h |
---|
| 466 | else |
---|
| 467 | echo '#define WITH_YAHOO' >> config.h |
---|
| 468 | protocols=$protocols'yahoo ' |
---|
[b5a22e3] | 469 | protoobjs=$protoobjs'yahoo_mod.o ' |
---|
[b7d3cc34] | 470 | fi |
---|
| 471 | |
---|
| 472 | if [ "$protocols" = "PROTOCOLS = " ]; then |
---|
[43462708] | 473 | echo "Warning: You haven't selected any communication protocol to compile!" |
---|
[b3c467b] | 474 | echo " BitlBee will run, but you will be unable to connect to IM servers!" |
---|
[b7d3cc34] | 475 | fi |
---|
| 476 | |
---|
| 477 | echo "PROTOCOLS = $protocols" >> Makefile.settings |
---|
| 478 | echo "PROTOOBJS = $protoobjs" >> Makefile.settings |
---|
| 479 | |
---|
| 480 | echo Architecture: $arch |
---|
| 481 | case "$arch" in |
---|
| 482 | Linux ) |
---|
| 483 | ;; |
---|
| 484 | GNU/* ) |
---|
| 485 | ;; |
---|
| 486 | *BSD ) |
---|
| 487 | ;; |
---|
| 488 | Darwin ) |
---|
| 489 | ;; |
---|
| 490 | IRIX ) |
---|
| 491 | ;; |
---|
[574af7e] | 492 | SunOS ) |
---|
| 493 | echo 'EFLAGS+=-lresolv -lnsl -lsocket' >> Makefile.settings |
---|
| 494 | echo 'STRIP=\# skip strip' >> Makefile.settings |
---|
| 495 | ;; |
---|
[8de63c3] | 496 | AIX ) |
---|
| 497 | echo 'EFLAGS+=-Wl,-brtl' >> Makefile.settings |
---|
| 498 | ;; |
---|
[b7d3cc34] | 499 | CYGWIN* ) |
---|
| 500 | echo 'Cygwin is not officially supported.' |
---|
| 501 | ;; |
---|
| 502 | * ) |
---|
[8d6c4b1] | 503 | echo 'We haven'\''t tested BitlBee on many platforms yet, yours is untested. YMMV.' |
---|
| 504 | echo 'Please report any problems at http://bugs.bitlbee.org/.' |
---|
[b7d3cc34] | 505 | ;; |
---|
| 506 | esac |
---|
| 507 | |
---|
| 508 | echo |
---|
| 509 | echo 'Configuration done:' |
---|
| 510 | |
---|
| 511 | if [ "$debug" = "1" ]; then |
---|
[b3c467b] | 512 | echo ' Debugging enabled.' |
---|
[b7d3cc34] | 513 | else |
---|
[b3c467b] | 514 | echo ' Debugging disabled.' |
---|
[b7d3cc34] | 515 | fi |
---|
| 516 | |
---|
| 517 | if [ "$strip" = "1" ]; then |
---|
[b3c467b] | 518 | echo ' Binary stripping enabled.' |
---|
[b7d3cc34] | 519 | else |
---|
[b3c467b] | 520 | echo ' Binary stripping disabled.' |
---|
[b7d3cc34] | 521 | fi |
---|
| 522 | |
---|
[764c7d1] | 523 | if [ "$otr" = "1" ]; then |
---|
| 524 | echo ' Off-the-Record (OTR) Messaging enabled.' |
---|
| 525 | else |
---|
| 526 | echo ' Off-the-Record (OTR) Messaging disabled.' |
---|
| 527 | fi |
---|
| 528 | |
---|
[b3c467b] | 529 | echo ' Using event handler: '$events |
---|
| 530 | echo ' Using SSL library: '$ssl |
---|
| 531 | echo ' Building with these storage backends: '$STORAGES |
---|
[b7d3cc34] | 532 | |
---|
| 533 | if [ -n "$protocols" ]; then |
---|
[b3c467b] | 534 | echo ' Building with these protocols:' $protocols |
---|
[b7d3cc34] | 535 | else |
---|
[b3c467b] | 536 | echo ' Building without IM-protocol support. We wish you a lot of fun...' |
---|
[b7d3cc34] | 537 | fi |
---|