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