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