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