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