[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/' |
---|
[57da960] | 11 | bindir='$prefix/bin/' |
---|
| 12 | sbindir='$prefix/sbin/' |
---|
[b7d3cc34] | 13 | etcdir='$prefix/etc/bitlbee/' |
---|
| 14 | mandir='$prefix/share/man/' |
---|
| 15 | datadir='$prefix/share/bitlbee/' |
---|
| 16 | config='/var/lib/bitlbee/' |
---|
[85cf37f] | 17 | plugindir='$prefix/lib/bitlbee/' |
---|
[8e5751e] | 18 | rpcplugindir='$plugindir/rpc/' |
---|
[85cf37f] | 19 | includedir='$prefix/include/bitlbee/' |
---|
[417002e] | 20 | systemdsystemunitdir='' |
---|
[85cf37f] | 21 | libevent='/usr/' |
---|
[34b17d9] | 22 | pidfile='/var/run/bitlbee.pid' |
---|
[4c225f0] | 23 | ipcsocket='' |
---|
[e506d6c] | 24 | pcdir='$prefix/lib/pkgconfig' |
---|
[25b80e9c] | 25 | systemlibdirs="/lib64 /usr/lib64 /usr/local/lib64 /lib /usr/lib /usr/local/lib" |
---|
[b7d3cc34] | 26 | |
---|
[04e2a05] | 27 | # Set these to default-on to let it be overriden by either the user or purple |
---|
| 28 | # |
---|
| 29 | # If the user sets one of these to 1, purple won't disable them. |
---|
| 30 | # Otherwise, if it's still default-on, it gets included in normal builds, |
---|
| 31 | # but not purple ones. |
---|
| 32 | msn="default-on" |
---|
| 33 | jabber="default-on" |
---|
| 34 | oscar="default-on" |
---|
| 35 | yahoo="default-on" |
---|
| 36 | |
---|
[1b221e0] | 37 | twitter=1 |
---|
[04dc563] | 38 | purple=0 |
---|
[8e5751e] | 39 | rpc=1 |
---|
[b7d3cc34] | 40 | |
---|
[a85a8ab] | 41 | doc=1 |
---|
[b7d3cc34] | 42 | debug=0 |
---|
| 43 | strip=1 |
---|
[66b9e86e] | 44 | gcov=0 |
---|
[e2472dd] | 45 | asan=0 |
---|
[2abfbc5] | 46 | plugins=1 |
---|
[04f0c10] | 47 | otr=0 |
---|
[370899f] | 48 | skype=0 |
---|
[85cf37f] | 49 | |
---|
| 50 | events=glib |
---|
[b7d3cc34] | 51 | ssl=auto |
---|
| 52 | |
---|
[7281ad1] | 53 | pie=1 |
---|
| 54 | |
---|
[b7d3cc34] | 55 | arch=`uname -s` |
---|
| 56 | cpu=`uname -m` |
---|
| 57 | |
---|
[34afea7] | 58 | GLIB_MIN_VERSION=2.16 |
---|
[670204f] | 59 | |
---|
[25c4c78] | 60 | # Cygwin and Darwin don't support PIC/PIE |
---|
| 61 | case "$arch" in |
---|
[a85a8ab] | 62 | CYGWIN* ) |
---|
| 63 | pie=0;; |
---|
| 64 | Darwin ) |
---|
| 65 | pie=0;; |
---|
[25c4c78] | 66 | esac |
---|
| 67 | |
---|
[70ec7ab] | 68 | get_version() { |
---|
| 69 | REAL_BITLBEE_VERSION=$(grep '^#define BITLBEE_VERSION ' $srcdir/bitlbee.h | sed 's/.*\"\(.*\)\".*/\1/') |
---|
[041777e] | 70 | |
---|
| 71 | if [ -n "$BITLBEE_VERSION" ]; then |
---|
| 72 | # environment variable already set to something to spoof it |
---|
| 73 | # don't replace it with the git stuff |
---|
| 74 | return |
---|
| 75 | fi |
---|
| 76 | |
---|
[70ec7ab] | 77 | BITLBEE_VERSION=$REAL_BITLBEE_VERSION |
---|
| 78 | |
---|
| 79 | if [ -d $srcdir/.git ] && type git > /dev/null 2> /dev/null; then |
---|
| 80 | timestamp=$(cd $srcdir; git show -s --format=%ci HEAD | sed 's/ .*$//; s/-//g') |
---|
| 81 | branch=$(cd $srcdir; git rev-parse --abbrev-ref HEAD) |
---|
| 82 | |
---|
[1d8cbc9] | 83 | search='\(.*\)-\([0-9]*\)-\(g[0-9a-f]*\)' |
---|
[70ec7ab] | 84 | replace="\1+$timestamp+$branch+\2-\3-git" |
---|
| 85 | |
---|
[e28c449] | 86 | describe=$(cd $srcdir; git describe --long --tags 2>/dev/null) |
---|
| 87 | if [ $? -ne 0 ]; then |
---|
| 88 | describe=${REAL_BITLBEE_VERSION}-0-g$(cd $srcdir; git rev-parse --short HEAD) |
---|
| 89 | fi |
---|
[70ec7ab] | 90 | |
---|
[c984ee3] | 91 | BITLBEE_VERSION=$(echo $describe | sed "s#$search#$replace#") |
---|
[e28c449] | 92 | |
---|
| 93 | unset timestamp branch search replace describe |
---|
[70ec7ab] | 94 | fi |
---|
| 95 | } |
---|
| 96 | |
---|
| 97 | if [ "$1" = "--dump-version" ]; then |
---|
| 98 | srcdir=$(cd $(dirname $0);pwd) |
---|
| 99 | get_version |
---|
| 100 | echo $BITLBEE_VERSION |
---|
| 101 | exit |
---|
| 102 | fi |
---|
| 103 | |
---|
| 104 | echo BitlBee configure |
---|
| 105 | |
---|
[b7d3cc34] | 106 | while [ -n "$1" ]; do |
---|
| 107 | e="`expr "X$1" : 'X--\(.*=.*\)'`" |
---|
| 108 | if [ -z "$e" ]; then |
---|
| 109 | cat<<EOF |
---|
| 110 | |
---|
| 111 | Usage: $0 [OPTIONS] |
---|
| 112 | |
---|
| 113 | Option Description Default |
---|
| 114 | |
---|
| 115 | --prefix=... Directories to put files in $prefix |
---|
| 116 | --bindir=... $bindir |
---|
[57da960] | 117 | --sbindir=... $sbindir |
---|
[b7d3cc34] | 118 | --etcdir=... $etcdir |
---|
| 119 | --mandir=... $mandir |
---|
| 120 | --datadir=... $datadir |
---|
[7b23afd] | 121 | --plugindir=... $plugindir |
---|
[8e5751e] | 122 | --rpcplugindir=... $rpcplugindir |
---|
[417002e] | 123 | --systemdsystemunitdir=... $systemdsystemunitdir |
---|
[34b17d9] | 124 | --pidfile=... $pidfile |
---|
[b7d3cc34] | 125 | --config=... $config |
---|
| 126 | |
---|
| 127 | --msn=0/1 Disable/enable MSN part $msn |
---|
| 128 | --jabber=0/1 Disable/enable Jabber part $jabber |
---|
| 129 | --oscar=0/1 Disable/enable Oscar part (ICQ, AIM) $oscar |
---|
| 130 | --yahoo=0/1 Disable/enable Yahoo part $yahoo |
---|
[4aa0f6b] | 131 | --twitter=0/1 Disable/enable Twitter part $twitter |
---|
[b7d3cc34] | 132 | |
---|
[796da03] | 133 | --purple=0/1 Disable/enable libpurple support $purple |
---|
[04f0c10] | 134 | (automatically disables other protocol modules) |
---|
[8e5751e] | 135 | --rpc=0/1 Disable/enable RPC plugin interface $rpc |
---|
[b7d3cc34] | 136 | |
---|
[a85a8ab] | 137 | --doc=0/1 Disable/enable help.txt generation $doc |
---|
[b7d3cc34] | 138 | --debug=0/1 Disable/enable debugging $debug |
---|
| 139 | --strip=0/1 Disable/enable binary stripping $strip |
---|
[7281ad1] | 140 | --pie=0/1 Build position independent executable $pie |
---|
[66b9e86e] | 141 | --gcov=0/1 Disable/enable test coverage reporting $gcov |
---|
[e2472dd] | 142 | --asan=0/1 Disable/enable AddressSanitizer $asan |
---|
[2abfbc5] | 143 | --plugins=0/1 Disable/enable plugins support $plugins |
---|
[04f0c10] | 144 | --otr=0/1/auto/plugin |
---|
| 145 | Disable/enable OTR encryption support $otr |
---|
[17f6079] | 146 | --skype=0/1/plugin |
---|
[370899f] | 147 | Disable/enable Skype support $skype |
---|
[b7d3cc34] | 148 | |
---|
[85cf37f] | 149 | --events=... Event handler (glib, libevent) $events |
---|
[e1d3f98] | 150 | --ssl=... SSL library to use (gnutls, nss, openssl, auto) |
---|
[b7d3cc34] | 151 | $ssl |
---|
[aec56b0] | 152 | |
---|
[7281ad1] | 153 | |
---|
[f1e7407] | 154 | --target=... Cross compilation target same as host |
---|
[b7d3cc34] | 155 | EOF |
---|
| 156 | exit; |
---|
| 157 | fi |
---|
| 158 | eval "$e" |
---|
| 159 | shift; |
---|
| 160 | done |
---|
| 161 | |
---|
| 162 | # Expand $prefix and get rid of double slashes |
---|
| 163 | bindir=`eval echo "$bindir/" | sed 's/\/\{1,\}/\//g'` |
---|
[57da960] | 164 | sbindir=`eval echo "$sbindir/" | sed 's/\/\{1,\}/\//g'` |
---|
[b7d3cc34] | 165 | etcdir=`eval echo "$etcdir/" | sed 's/\/\{1,\}/\//g'` |
---|
| 166 | mandir=`eval echo "$mandir/" | sed 's/\/\{1,\}/\//g'` |
---|
| 167 | datadir=`eval echo "$datadir/" | sed 's/\/\{1,\}/\//g'` |
---|
| 168 | config=`eval echo "$config/" | sed 's/\/\{1,\}/\//g'` |
---|
[7b23afd] | 169 | plugindir=`eval echo "$plugindir/" | sed 's/\/\{1,\}/\//g'` |
---|
[8e5751e] | 170 | rpcplugindir=$(eval echo "$rpcplugindir/" | sed 's/\/\{1,\}/\//g') |
---|
[85cf37f] | 171 | includedir=`eval echo "$includedir"/ | sed 's/\/\{1,\}/\//g'` |
---|
| 172 | libevent=`eval echo "$libevent"/ | sed 's/\/\{1,\}/\//g'` |
---|
| 173 | |
---|
[6dff9d4] | 174 | pidfile=`eval echo "$pidfile" | sed 's/\/\{1,\}/\//g'` |
---|
| 175 | ipcsocket=`eval echo "$ipcsocket" | sed 's/\/\{1,\}/\//g'` |
---|
[e506d6c] | 176 | pcdir=`eval echo "$pcdir" | sed 's/\/\{1,\}/\//g'` |
---|
[b7d3cc34] | 177 | |
---|
[17f6079] | 178 | protocols_mods="" |
---|
| 179 | |
---|
[b95b0c8] | 180 | cat <<EOF >Makefile.settings |
---|
[b7d3cc34] | 181 | ## BitlBee settings, generated by configure |
---|
| 182 | PREFIX=$prefix |
---|
| 183 | BINDIR=$bindir |
---|
[57da960] | 184 | SBINDIR=$sbindir |
---|
[b7d3cc34] | 185 | ETCDIR=$etcdir |
---|
| 186 | MANDIR=$mandir |
---|
| 187 | DATADIR=$datadir |
---|
[7b23afd] | 188 | PLUGINDIR=$plugindir |
---|
[8e5751e] | 189 | RPCPLUGINDIR=$rpcplugindir |
---|
[b7d3cc34] | 190 | CONFIG=$config |
---|
[e506d6c] | 191 | INCLUDEDIR=$includedir |
---|
| 192 | PCDIR=$pcdir |
---|
[b7d3cc34] | 193 | |
---|
[1bf9492] | 194 | TARGET=$target |
---|
[b7d3cc34] | 195 | ARCH=$arch |
---|
| 196 | CPU=$cpu |
---|
| 197 | |
---|
[25b80e9c] | 198 | INSTALL=install -p |
---|
| 199 | |
---|
[b7d3cc34] | 200 | DESTDIR= |
---|
| 201 | LFLAGS= |
---|
[7a80925] | 202 | EFLAGS=-lm |
---|
[b7d3cc34] | 203 | EOF |
---|
| 204 | |
---|
[1074806] | 205 | srcdir=$(cd $(dirname $0);pwd) |
---|
| 206 | currdir=$(pwd) |
---|
| 207 | if [ "$srcdir" != "$currdir" ]; then |
---|
[f60079b] | 208 | echo |
---|
| 209 | echo "configure script run from a different directory. Will create some symlinks..." |
---|
| 210 | if [ ! -e Makefile -o -L Makefile ]; then |
---|
[04dc563] | 211 | COPYDIRS="doc lib protocols tests utils" |
---|
| 212 | mkdir -p $(cd "$srcdir"; find $COPYDIRS -type d) |
---|
[f60079b] | 213 | find . -name Makefile -type l -print0 | xargs -0 rm 2> /dev/null |
---|
| 214 | dst="$PWD" |
---|
| 215 | cd "$srcdir" |
---|
[04dc563] | 216 | for i in $(find . -name Makefile -type f); do |
---|
[f60079b] | 217 | ln -s "$PWD${i#.}" "$dst/$i"; |
---|
| 218 | done |
---|
| 219 | cd "$dst" |
---|
| 220 | rm -rf .bzr |
---|
| 221 | fi |
---|
| 222 | |
---|
[7fa5c19] | 223 | echo "_SRCDIR_=$srcdir/" >> Makefile.settings |
---|
[f60079b] | 224 | CFLAGS="$CFLAGS -I${dst}" |
---|
| 225 | else |
---|
| 226 | srcdir=$PWD |
---|
| 227 | fi |
---|
| 228 | |
---|
[b95b0c8] | 229 | cat<<EOF >config.h |
---|
[b7d3cc34] | 230 | /* BitlBee settings, generated by configure |
---|
| 231 | |
---|
| 232 | Do *NOT* use any of these defines in your code without thinking twice, most |
---|
| 233 | of them can/will be overridden at run-time */ |
---|
| 234 | |
---|
| 235 | #define CONFIG "$config" |
---|
| 236 | #define ETCDIR "$etcdir" |
---|
| 237 | #define VARDIR "$datadir" |
---|
[7b23afd] | 238 | #define PLUGINDIR "$plugindir" |
---|
[8e5751e] | 239 | #define RPCPLUGINDIR "$rpcplugindir" |
---|
[34b17d9] | 240 | #define PIDFILE "$pidfile" |
---|
[6dff9d4] | 241 | #define IPCSOCKET "$ipcsocket" |
---|
[b7d3cc34] | 242 | #define ARCH "$arch" |
---|
| 243 | #define CPU "$cpu" |
---|
| 244 | EOF |
---|
| 245 | |
---|
[1bf9492] | 246 | |
---|
| 247 | |
---|
[f1e7407] | 248 | if [ -n "$target" ]; then |
---|
[1bf9492] | 249 | PKG_CONFIG_LIBDIR=/usr/$target/lib/pkgconfig |
---|
| 250 | export PKG_CONFIG_LIBDIR |
---|
[f1e7407] | 251 | PATH=/usr/$target/bin:$PATH |
---|
| 252 | CC=$target-cc |
---|
| 253 | LD=$target-ld |
---|
[1bf9492] | 254 | systemlibdirs="/usr/$target/lib" |
---|
[f1e7407] | 255 | fi |
---|
| 256 | |
---|
[e2472dd] | 257 | if [ "$asan" = "1" ]; then |
---|
| 258 | CFLAGS="$CFLAGS -fsanitize=address" |
---|
| 259 | LDFLAGS="$LDFLAGS -fsanitize=address" |
---|
| 260 | debug=1 |
---|
| 261 | fi |
---|
[1bf9492] | 262 | |
---|
[8e5751e] | 263 | if [ "$tsan" = "1" ]; then |
---|
| 264 | echo |
---|
| 265 | echo "Threaded BitlBee? Have a nice tall glass of http://imgur.com/gallery/tX4qxzS" |
---|
| 266 | echo "No need to sanitise threads in a single-threaded process!" |
---|
| 267 | fi |
---|
| 268 | |
---|
[b7d3cc34] | 269 | if [ "$debug" = "1" ]; then |
---|
| 270 | echo 'DEBUG=1' >> Makefile.settings |
---|
[e2472dd] | 271 | CFLAGS="$CFLAGS -g3 -DDEBUG -O0" |
---|
[b7d3cc34] | 272 | else |
---|
[56f260a] | 273 | [ -z "$CFLAGS" ] && CFLAGS="-O2 -fno-strict-aliasing" |
---|
[b7d3cc34] | 274 | fi |
---|
| 275 | |
---|
[7281ad1] | 276 | if [ "$pie" = "1" ]; then |
---|
| 277 | echo 'CFLAGS_BITLBEE=-fPIE' >> Makefile.settings |
---|
| 278 | echo 'LDFLAGS_BITLBEE=-pie' >> Makefile.settings |
---|
| 279 | fi |
---|
| 280 | |
---|
[d203495] | 281 | echo LDFLAGS=$LDFLAGS >> Makefile.settings |
---|
| 282 | |
---|
[daae10f] | 283 | echo CFLAGS=$CFLAGS $CPPFLAGS >> Makefile.settings |
---|
[f60079b] | 284 | echo CFLAGS+=-I${srcdir} -I${srcdir}/lib -I${srcdir}/protocols -I. >> Makefile.settings |
---|
[b7d3cc34] | 285 | |
---|
[41a94dd] | 286 | echo CFLAGS+=-DHAVE_CONFIG_H -D_GNU_SOURCE >> Makefile.settings |
---|
[f712188] | 287 | |
---|
[b7d3cc34] | 288 | if [ -n "$CC" ]; then |
---|
[5973412] | 289 | CC=$CC |
---|
[b7d3cc34] | 290 | elif type gcc > /dev/null 2> /dev/null; then |
---|
[5973412] | 291 | CC=gcc |
---|
[b7d3cc34] | 292 | elif type cc > /dev/null 2> /dev/null; then |
---|
[5973412] | 293 | CC=cc |
---|
[b7d3cc34] | 294 | else |
---|
| 295 | echo 'Cannot find a C compiler, aborting.' |
---|
| 296 | exit 1; |
---|
| 297 | fi |
---|
| 298 | |
---|
[5973412] | 299 | echo "CC=$CC" >> Makefile.settings; |
---|
[daae10f] | 300 | if echo $CC | grep -qw gcc; then |
---|
| 301 | # Apparently -Wall is gcc-specific? |
---|
| 302 | echo CFLAGS+=-Wall >> Makefile.settings |
---|
| 303 | fi |
---|
[5973412] | 304 | |
---|
[f1e7407] | 305 | if [ -z "$LD" ]; then |
---|
| 306 | if type ld > /dev/null 2> /dev/null; then |
---|
| 307 | LD=ld |
---|
| 308 | else |
---|
| 309 | echo 'Cannot find ld, aborting.' |
---|
| 310 | exit 1; |
---|
| 311 | fi |
---|
[b7d3cc34] | 312 | fi |
---|
| 313 | |
---|
[f1e7407] | 314 | echo "LD=$LD" >> Makefile.settings |
---|
| 315 | |
---|
[32c632f] | 316 | if [ -z "$PKG_CONFIG" ]; then |
---|
| 317 | PKG_CONFIG=pkg-config |
---|
| 318 | fi |
---|
| 319 | |
---|
| 320 | if $PKG_CONFIG --version > /dev/null 2>/dev/null && $PKG_CONFIG glib-2.0; then |
---|
[670204f] | 321 | if $PKG_CONFIG glib-2.0 --atleast-version=$GLIB_MIN_VERSION; then |
---|
[b95b0c8] | 322 | cat<<EOF >>Makefile.settings |
---|
[32c632f] | 323 | EFLAGS+=`$PKG_CONFIG --libs glib-2.0 gmodule-2.0` |
---|
| 324 | CFLAGS+=`$PKG_CONFIG --cflags glib-2.0 gmodule-2.0` |
---|
[b7d3cc34] | 325 | EOF |
---|
[670204f] | 326 | else |
---|
| 327 | echo |
---|
| 328 | echo 'Found glib2 '`$PKG_CONFIG glib-2.0 --modversion`', but version '$GLIB_MIN_VERSION' or newer is required.' |
---|
| 329 | exit 1 |
---|
| 330 | fi |
---|
[b7d3cc34] | 331 | else |
---|
[670204f] | 332 | echo |
---|
[574af7e] | 333 | echo 'Cannot find glib2 development libraries, aborting. (Install libglib2-dev?)' |
---|
[670204f] | 334 | exit 1 |
---|
[b7d3cc34] | 335 | fi |
---|
| 336 | |
---|
[85cf37f] | 337 | if [ "$events" = "libevent" ]; then |
---|
[003553b] | 338 | if ! [ -f "${libevent}include/event.h" ]; then |
---|
[85cf37f] | 339 | echo |
---|
| 340 | echo 'Warning: Could not find event.h, you might have to install it and/or specify' |
---|
| 341 | echo 'its location using the --libevent= argument. (Example: If event.h is in' |
---|
| 342 | echo '/usr/local/include and binaries are in /usr/local/lib: --libevent=/usr/local)' |
---|
| 343 | fi |
---|
| 344 | |
---|
| 345 | echo '#define EVENTS_LIBEVENT' >> config.h |
---|
[b95b0c8] | 346 | cat <<EOF >>Makefile.settings |
---|
[85cf37f] | 347 | EFLAGS+=-levent -L${libevent}lib |
---|
| 348 | CFLAGS+=-I${libevent}include |
---|
| 349 | EOF |
---|
| 350 | elif [ "$events" = "glib" ]; then |
---|
| 351 | ## We already use glib anyway, so this is all we need (and in fact not even this, but just to be sure...): |
---|
| 352 | echo '#define EVENTS_GLIB' >> config.h |
---|
[b7d3cc34] | 353 | else |
---|
| 354 | echo |
---|
[85cf37f] | 355 | echo 'ERROR: Unknown event handler specified.' |
---|
| 356 | exit 1 |
---|
[b7d3cc34] | 357 | fi |
---|
[85cf37f] | 358 | echo 'EVENT_HANDLER=events_'$events'.o' >> Makefile.settings |
---|
[b7d3cc34] | 359 | |
---|
| 360 | detect_gnutls() |
---|
| 361 | { |
---|
[4af7b4f] | 362 | if $PKG_CONFIG --exists gnutls; then |
---|
[b95b0c8] | 363 | cat <<EOF >>Makefile.settings |
---|
[83e47ec] | 364 | EFLAGS+=`$PKG_CONFIG --libs gnutls` `libgcrypt-config --libs` |
---|
| 365 | CFLAGS+=`$PKG_CONFIG --cflags gnutls` `libgcrypt-config --cflags` |
---|
[4af7b4f] | 366 | EOF |
---|
| 367 | ssl=gnutls |
---|
[5513f3e] | 368 | if ! pkg-config gnutls --atleast-version=2.8; then |
---|
| 369 | echo |
---|
| 370 | echo 'Warning: With GnuTLS versions <2.8, certificate expire dates are not verified.' |
---|
| 371 | fi |
---|
[4af7b4f] | 372 | ret=1 |
---|
| 373 | elif libgnutls-config --version > /dev/null 2> /dev/null; then |
---|
[b95b0c8] | 374 | cat <<EOF >>Makefile.settings |
---|
[83e47ec] | 375 | EFLAGS+=`libgnutls-config --libs` `libgcrypt-config --libs` |
---|
| 376 | CFLAGS+=`libgnutls-config --cflags` `libgcrypt-config --cflags` |
---|
[b7d3cc34] | 377 | EOF |
---|
| 378 | |
---|
| 379 | ssl=gnutls |
---|
| 380 | ret=1; |
---|
| 381 | else |
---|
| 382 | ret=0; |
---|
| 383 | fi; |
---|
| 384 | } |
---|
| 385 | |
---|
| 386 | detect_nss() |
---|
| 387 | { |
---|
[ef043d3] | 388 | if $PKG_CONFIG --version > /dev/null 2>/dev/null && $PKG_CONFIG nss; then |
---|
[b95b0c8] | 389 | cat<<EOF >>Makefile.settings |
---|
[ef043d3] | 390 | EFLAGS+=`$PKG_CONFIG --libs nss` |
---|
| 391 | CFLAGS+=`$PKG_CONFIG --cflags nss` |
---|
[b7d3cc34] | 392 | EOF |
---|
| 393 | |
---|
| 394 | ssl=nss |
---|
| 395 | ret=1; |
---|
| 396 | else |
---|
| 397 | ret=0; |
---|
| 398 | fi; |
---|
| 399 | } |
---|
| 400 | |
---|
[36cf9fd] | 401 | RESOLV_TESTCODE=' |
---|
[aee8c19] | 402 | #include <sys/types.h> |
---|
| 403 | #include <netinet/in.h> |
---|
[36cf9fd] | 404 | #include <arpa/nameser.h> |
---|
| 405 | #include <resolv.h> |
---|
| 406 | |
---|
[632627e] | 407 | int main() |
---|
| 408 | { |
---|
| 409 | |
---|
| 410 | res_query( NULL, 0, 0, NULL, 0); |
---|
| 411 | dn_expand( NULL, NULL, NULL, NULL, 0); |
---|
| 412 | dn_skipname( NULL, NULL); |
---|
| 413 | } |
---|
| 414 | ' |
---|
| 415 | RESOLV_NS_TESTCODE=' |
---|
| 416 | #include <sys/types.h> |
---|
| 417 | #include <netinet/in.h> |
---|
| 418 | #include <arpa/nameser.h> |
---|
| 419 | #include <resolv.h> |
---|
| 420 | |
---|
[36cf9fd] | 421 | int main() |
---|
| 422 | { |
---|
| 423 | ns_initparse( NULL, 0, NULL ); |
---|
| 424 | ns_parserr( NULL, ns_s_an, 0, NULL ); |
---|
| 425 | } |
---|
| 426 | ' |
---|
[632627e] | 427 | RESOLV_NS_TYPES_TESTCODE=' |
---|
| 428 | #include <sys/types.h> |
---|
| 429 | #include <netinet/in.h> |
---|
| 430 | #include <arpa/nameser.h> |
---|
| 431 | |
---|
| 432 | int main() |
---|
| 433 | { |
---|
| 434 | ns_msg nsh; |
---|
| 435 | ns_rr rr; |
---|
| 436 | |
---|
[fb87924] | 437 | /* Not all platforms we want to work on have |
---|
| 438 | ns_* routines, so use this to make sure |
---|
| 439 | the compiler uses it.*/ |
---|
| 440 | return (int)(sizeof(nsh) + sizeof(rr)); |
---|
[632627e] | 441 | } |
---|
| 442 | ' |
---|
[36cf9fd] | 443 | |
---|
| 444 | detect_resolv_dynamic() |
---|
| 445 | { |
---|
[aee8c19] | 446 | case "$arch" in |
---|
[632627e] | 447 | OpenBSD ) |
---|
| 448 | # In FreeBSD res_*/dn_* routines are present in libc.so |
---|
| 449 | LIBRESOLV=;; |
---|
[aee8c19] | 450 | FreeBSD ) |
---|
[632627e] | 451 | # In FreeBSD res_*/dn_* routines are present in libc.so |
---|
| 452 | LIBRESOLV=;; |
---|
| 453 | CYGWIN* ) |
---|
| 454 | # In Cygwin res_*/dn_* routines are present in libc.so |
---|
[aee8c19] | 455 | LIBRESOLV=;; |
---|
| 456 | * ) |
---|
| 457 | LIBRESOLV=-lresolv;; |
---|
| 458 | esac |
---|
[4fca1db] | 459 | TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX) |
---|
[8462239] | 460 | ret=1 |
---|
[aee8c19] | 461 | echo "$RESOLV_TESTCODE" | $CC -o $TMPFILE -x c - $LIBRESOLV >/dev/null 2>/dev/null |
---|
[36cf9fd] | 462 | if [ "$?" = "0" ]; then |
---|
[aee8c19] | 463 | echo "EFLAGS+=$LIBRESOLV" >> Makefile.settings |
---|
[8462239] | 464 | ret=0 |
---|
[36cf9fd] | 465 | fi |
---|
| 466 | |
---|
[8462239] | 467 | rm -f $TMPFILE |
---|
| 468 | return $ret |
---|
[36cf9fd] | 469 | } |
---|
| 470 | |
---|
| 471 | detect_resolv_static() |
---|
| 472 | { |
---|
[4fca1db] | 473 | TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX) |
---|
[8462239] | 474 | ret=1 |
---|
[36cf9fd] | 475 | for i in $systemlibdirs; do |
---|
| 476 | if [ -f $i/libresolv.a ]; then |
---|
[8462239] | 477 | echo "$RESOLV_TESTCODE" | $CC -o $TMPFILE -x c - -Wl,$i/libresolv.a >/dev/null 2>/dev/null |
---|
[36cf9fd] | 478 | if [ "$?" = "0" ]; then |
---|
| 479 | echo 'EFLAGS+='$i'/libresolv.a' >> Makefile.settings |
---|
[8462239] | 480 | ret=0 |
---|
[36cf9fd] | 481 | fi |
---|
| 482 | fi |
---|
| 483 | done |
---|
| 484 | |
---|
[8462239] | 485 | rm -f $TMPFILE |
---|
| 486 | return $ret |
---|
[36cf9fd] | 487 | } |
---|
| 488 | |
---|
[632627e] | 489 | detect_resolv_ns_dynamic() |
---|
| 490 | { |
---|
| 491 | case "$arch" in |
---|
| 492 | FreeBSD ) |
---|
| 493 | # In FreeBSD ns_ routines are present in libc.so |
---|
| 494 | LIBRESOLV=;; |
---|
| 495 | * ) |
---|
| 496 | LIBRESOLV=-lresolv;; |
---|
| 497 | esac |
---|
| 498 | TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX) |
---|
| 499 | ret=1 |
---|
| 500 | echo "$RESOLV_NS_TESTCODE" | $CC -o $TMPFILE -x c - $LIBRESOLV >/dev/null 2>/dev/null |
---|
[a67e781] | 501 | if [ "$?" = "0" ]; then |
---|
| 502 | ret=0 |
---|
| 503 | fi |
---|
[632627e] | 504 | |
---|
| 505 | rm -f $TMPFILE |
---|
| 506 | return $ret |
---|
| 507 | } |
---|
| 508 | |
---|
| 509 | detect_resolv_ns_static() |
---|
| 510 | { |
---|
| 511 | TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX) |
---|
| 512 | ret=1 |
---|
| 513 | for i in $systemlibdirs; do |
---|
| 514 | if [ -f $i/libresolv.a ]; then |
---|
| 515 | echo "$RESOLV_NS_TESTCODE" | $CC -o $TMPFILE -x c - -Wl,$i/libresolv.a >/dev/null 2>/dev/null |
---|
[a67e781] | 516 | if [ "$?" = "0" ]; then |
---|
| 517 | ret=0 |
---|
| 518 | fi |
---|
[632627e] | 519 | fi |
---|
| 520 | done |
---|
| 521 | |
---|
| 522 | rm -f $TMPFILE |
---|
| 523 | return $ret |
---|
| 524 | } |
---|
| 525 | |
---|
| 526 | detect_nameser_has_ns_types() |
---|
| 527 | { |
---|
[a67e781] | 528 | TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX) |
---|
| 529 | ret=1 |
---|
| 530 | # since we aren't actually linking with ns_* routines |
---|
| 531 | # we can just compile the test code |
---|
| 532 | echo "$RESOLV_NS_TYPES_TESTCODE" | $CC -o $TMPFILE -x c - >/dev/null 2>/dev/null |
---|
| 533 | if [ "$?" = "0" ]; then |
---|
| 534 | ret=0 |
---|
| 535 | fi |
---|
| 536 | |
---|
| 537 | rm -f $TMPFILE |
---|
| 538 | return $ret |
---|
[632627e] | 539 | } |
---|
| 540 | |
---|
[b3c467b] | 541 | if [ "$ssl" = "auto" ]; then |
---|
| 542 | detect_gnutls |
---|
[b7d3cc34] | 543 | if [ "$ret" = "0" ]; then |
---|
[c5920df] | 544 | # Disable NSS for now as it's known to not work very well ATM. |
---|
| 545 | #detect_nss |
---|
[191cfb1] | 546 | : |
---|
[b7d3cc34] | 547 | fi |
---|
[b3c467b] | 548 | elif [ "$ssl" = "gnutls" ]; then |
---|
| 549 | detect_gnutls |
---|
| 550 | elif [ "$ssl" = "nss" ]; then |
---|
| 551 | detect_nss |
---|
| 552 | elif [ "$ssl" = "openssl" ]; then |
---|
| 553 | echo |
---|
| 554 | echo 'No detection code exists for OpenSSL. Make sure that you have a complete' |
---|
[b3eee9b] | 555 | echo 'installation of OpenSSL (including devel/header files) before reporting' |
---|
[b3c467b] | 556 | echo 'compilation problems.' |
---|
| 557 | echo |
---|
| 558 | echo 'Also, keep in mind that the OpenSSL is, according to some people, not' |
---|
[b3eee9b] | 559 | echo 'completely GPL-compatible. Using GnuTLS is recommended and better supported' |
---|
| 560 | echo 'by us. However, on many BSD machines, OpenSSL can be considered part of the' |
---|
| 561 | echo 'operating system, which makes it GPL-compatible.' |
---|
[b3c467b] | 562 | echo |
---|
| 563 | echo 'For more info, see: http://www.openssl.org/support/faq.html#LEGAL2' |
---|
| 564 | echo ' http://www.gnome.org/~markmc/openssl-and-the-gpl.html' |
---|
| 565 | echo |
---|
| 566 | echo 'Please note that distributing a BitlBee binary which links to OpenSSL is' |
---|
| 567 | echo 'probably illegal. If you want to create and distribute a binary BitlBee' |
---|
[b3eee9b] | 568 | echo 'package, you really should use GnuTLS instead.' |
---|
[b3c467b] | 569 | echo |
---|
| 570 | echo 'Also, the OpenSSL license requires us to say this:' |
---|
| 571 | echo ' * "This product includes software developed by the OpenSSL Project' |
---|
| 572 | echo ' * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"' |
---|
[b7d3cc34] | 573 | |
---|
[b3c467b] | 574 | echo 'EFLAGS+=-lssl -lcrypto' >> Makefile.settings |
---|
| 575 | |
---|
| 576 | ret=1 |
---|
| 577 | else |
---|
| 578 | echo |
---|
| 579 | echo 'ERROR: Unknown SSL library specified.' |
---|
| 580 | exit 1 |
---|
[b7d3cc34] | 581 | fi |
---|
| 582 | |
---|
[b3c467b] | 583 | if [ "$ret" = "0" ]; then |
---|
| 584 | echo |
---|
| 585 | echo 'ERROR: Could not find a suitable SSL library (GnuTLS, libnss or OpenSSL).' |
---|
| 586 | echo ' Please note that this script doesn'\''t have detection code for OpenSSL,' |
---|
[e1d3f98] | 587 | echo ' so if you want to use that, you have to select it by hand.' |
---|
[b7d3cc34] | 588 | |
---|
[b3c467b] | 589 | exit 1 |
---|
| 590 | fi; |
---|
| 591 | |
---|
| 592 | echo 'SSL_CLIENT=ssl_'$ssl'.o' >> Makefile.settings |
---|
| 593 | |
---|
[632627e] | 594 | if detect_nameser_has_ns_types; then |
---|
| 595 | echo '#define NAMESER_HAS_NS_TYPES' >> config.h |
---|
| 596 | fi |
---|
[36cf9fd] | 597 | if detect_resolv_dynamic || detect_resolv_static; then |
---|
| 598 | echo '#define HAVE_RESOLV_A' >> config.h |
---|
[a67e781] | 599 | if detect_resolv_ns_dynamic || detect_resolv_ns_static; then |
---|
| 600 | echo '#define HAVE_RESOLV_A_WITH_NS' >> config.h |
---|
| 601 | fi |
---|
[632627e] | 602 | else |
---|
[a67e781] | 603 | echo 'Insufficient resolv routines. Jabber server must be set explicitly' |
---|
[36cf9fd] | 604 | fi |
---|
[36e9f62] | 605 | |
---|
[632627e] | 606 | |
---|
[ba7d16f] | 607 | STORAGES="xml" |
---|
[b3c467b] | 608 | |
---|
| 609 | for i in $STORAGES; do |
---|
| 610 | STORAGE_OBJS="$STORAGE_OBJS storage_$i.o" |
---|
| 611 | done |
---|
| 612 | echo "STORAGE_OBJS="$STORAGE_OBJS >> Makefile.settings |
---|
| 613 | |
---|
[b7d3cc34] | 614 | if [ "$strip" = 0 ]; then |
---|
| 615 | echo "STRIP=\# skip strip" >> Makefile.settings; |
---|
| 616 | else |
---|
| 617 | if [ "$debug" = 1 ]; then |
---|
| 618 | echo |
---|
| 619 | echo 'Stripping binaries does not make sense when debugging. Stripping disabled.' |
---|
| 620 | echo 'STRIP=\# skip strip' >> Makefile.settings |
---|
| 621 | strip=0; |
---|
| 622 | elif [ -n "$STRIP" ]; then |
---|
| 623 | echo "STRIP=$STRIP" >> Makefile.settings; |
---|
| 624 | elif type strip > /dev/null 2> /dev/null; then |
---|
| 625 | echo "STRIP=strip" >> Makefile.settings; |
---|
| 626 | else |
---|
| 627 | echo |
---|
| 628 | echo 'No strip utility found, cannot remove unnecessary parts from executable.' |
---|
| 629 | echo 'STRIP=\# skip strip' >> Makefile.settings |
---|
| 630 | strip=0; |
---|
| 631 | fi; |
---|
| 632 | fi |
---|
| 633 | |
---|
[417002e] | 634 | if [ -z "$systemdsystemunitdir" ]; then |
---|
| 635 | if $PKG_CONFIG --exists systemd; then |
---|
| 636 | systemdsystemunitdir=`$PKG_CONFIG --variable=systemdsystemunitdir systemd` |
---|
| 637 | fi |
---|
| 638 | fi |
---|
| 639 | if [ -n "$systemdsystemunitdir" ]; then |
---|
| 640 | if [ "$systemdsystemunitdir" != "no" ]; then |
---|
| 641 | echo "SYSTEMDSYSTEMUNITDIR=$systemdsystemunitdir" >> Makefile.settings |
---|
| 642 | fi |
---|
| 643 | fi |
---|
| 644 | |
---|
[66b9e86e] | 645 | if [ "$gcov" = "1" ]; then |
---|
[31fc3970] | 646 | echo "CFLAGS+=--coverage" >> Makefile.settings |
---|
| 647 | echo "EFLAGS+=--coverage" >> Makefile.settings |
---|
[66b9e86e] | 648 | fi |
---|
| 649 | |
---|
[2abfbc5] | 650 | if [ "$plugins" = 0 ]; then |
---|
[489847f] | 651 | plugindir="" |
---|
[2abfbc5] | 652 | echo '#undef WITH_PLUGINS' >> config.h |
---|
| 653 | else |
---|
| 654 | echo '#define WITH_PLUGINS' >> config.h |
---|
| 655 | fi |
---|
| 656 | |
---|
[8e5751e] | 657 | if [ "$rpc" = 0 ]; then |
---|
| 658 | # Somewhat pointless at this stage already but at least this keeps it |
---|
| 659 | # out of bitlbee.pc which is probably a good thing. |
---|
| 660 | rpcplugindir="" |
---|
| 661 | fi |
---|
| 662 | |
---|
[6738a67] | 663 | otrprefix="" |
---|
| 664 | for i in / /usr /usr/local; do |
---|
| 665 | if [ -f ${i}/lib/libotr.a ]; then |
---|
| 666 | otrprefix=${i} |
---|
| 667 | break |
---|
| 668 | fi |
---|
| 669 | done |
---|
[764c7d1] | 670 | if [ "$otr" = "auto" ]; then |
---|
[6738a67] | 671 | if [ -n "$otrprefix" ]; then |
---|
| 672 | otr=1 |
---|
| 673 | else |
---|
| 674 | otr=0 |
---|
| 675 | fi |
---|
[764c7d1] | 676 | fi |
---|
[6738a67] | 677 | if [ "$otr" = 1 ]; then |
---|
[858ea01] | 678 | # BI == built-in |
---|
| 679 | echo '#define OTR_BI' >> config.h |
---|
[d348377] | 680 | echo "EFLAGS+=-L${otrprefix}/lib -lotr -lgcrypt" >> Makefile.settings |
---|
[6738a67] | 681 | echo "CFLAGS+=-I${otrprefix}/include" >> Makefile.settings |
---|
[858ea01] | 682 | echo 'OTR_BI=otr.o' >> Makefile.settings |
---|
| 683 | elif [ "$otr" = "plugin" ]; then |
---|
| 684 | echo '#define OTR_PI' >> config.h |
---|
| 685 | echo "OTRFLAGS=-L${otrprefix}/lib -lotr" >> Makefile.settings |
---|
| 686 | echo "CFLAGS+=-I${otrprefix}/include" >> Makefile.settings |
---|
| 687 | echo 'OTR_PI=otr.so' >> Makefile.settings |
---|
[764c7d1] | 688 | fi |
---|
[a8aa823] | 689 | if [ "$otr" != 0 ] && ! pkg-config libotr --atleast-version=4.0; then |
---|
| 690 | echo |
---|
| 691 | echo 'WARNING: Your libotr seems to be old. BitlBee now needs at least libotr 4.0.' |
---|
| 692 | # Not hard-failing because the code above doesn't use pkg-config, so who knows |
---|
| 693 | # what's true at this point... |
---|
| 694 | fi |
---|
[764c7d1] | 695 | |
---|
[17f6079] | 696 | if [ "$skype" = "1" -o "$skype" = "plugin" ]; then |
---|
[b2b7f52] | 697 | if [ "$arch" = "Darwin" ]; then |
---|
| 698 | echo "SKYPEFLAGS=-dynamiclib -undefined dynamic_lookup" >> Makefile.settings |
---|
| 699 | else |
---|
| 700 | echo "SKYPEFLAGS=-fPIC -shared" >> Makefile.settings |
---|
| 701 | fi |
---|
[370899f] | 702 | echo 'SKYPE_PI=skype.so' >> Makefile.settings |
---|
[17f6079] | 703 | protocols_mods="$protocol_mods skype(plugin)" |
---|
[370899f] | 704 | fi |
---|
| 705 | |
---|
[1cef55f] | 706 | if [ -z "$PYTHON" ]; then |
---|
| 707 | PYTHON=python |
---|
| 708 | fi |
---|
| 709 | |
---|
[a85a8ab] | 710 | if [ "$doc" = "1" ]; then |
---|
[beb0f54] | 711 | # check this here just in case someone tries to install it in python2.4... |
---|
[1cef55f] | 712 | if ! $PYTHON -m xml.etree.ElementTree > /dev/null 2>&1; then |
---|
[a85a8ab] | 713 | echo |
---|
[beb0f54] | 714 | echo 'ERROR: Python (>=2.5 or 3.x) is required to generate docs' |
---|
[1cef55f] | 715 | echo "(Use the PYTHON environment variable if it's in a weird location)" |
---|
[beb0f54] | 716 | exit 1 |
---|
[a85a8ab] | 717 | fi |
---|
[beb0f54] | 718 | echo "DOC=1" >> Makefile.settings |
---|
[1cef55f] | 719 | echo "PYTHON=$PYTHON" >> Makefile.settings |
---|
[e26aa72] | 720 | fi |
---|
| 721 | |
---|
[70ec7ab] | 722 | get_version |
---|
[e26aa72] | 723 | |
---|
[70ec7ab] | 724 | if [ "$BITLBEE_VERSION" != "$REAL_BITLBEE_VERSION" ]; then |
---|
[b7d3cc34] | 725 | echo 'Spoofing version number: '$BITLBEE_VERSION |
---|
| 726 | echo '#undef BITLBEE_VERSION' >> config.h |
---|
[f287f04] | 727 | echo '#define BITLBEE_VERSION "'$BITLBEE_VERSION'"' >> config.h |
---|
[ffea9b9] | 728 | echo |
---|
[b7d3cc34] | 729 | fi |
---|
| 730 | |
---|
[4fca1db] | 731 | if ! make helloworld > /dev/null 2>&1; then |
---|
| 732 | echo "WARNING: Your version of make (BSD make?) does not support BitlBee's makefiles." |
---|
| 733 | echo "BitlBee needs GNU make to build properly. On most systems GNU make is available" |
---|
| 734 | echo "under the name 'gmake'." |
---|
| 735 | echo |
---|
| 736 | if gmake helloworld > /dev/null 2>&1; then |
---|
| 737 | echo "gmake seems to be available on your machine, great." |
---|
| 738 | echo |
---|
| 739 | else |
---|
| 740 | echo "gmake is not installed (or not working). Please try to install it." |
---|
| 741 | echo |
---|
| 742 | fi |
---|
| 743 | fi |
---|
| 744 | |
---|
[b95b0c8] | 745 | cat <<EOF >bitlbee.pc |
---|
[e506d6c] | 746 | prefix=$prefix |
---|
| 747 | includedir=$includedir |
---|
[489847f] | 748 | plugindir=$plugindir |
---|
[8e5751e] | 749 | rpcplugindir=$rpcplugindir |
---|
[e506d6c] | 750 | |
---|
| 751 | Name: bitlbee |
---|
| 752 | Description: IRC to IM gateway |
---|
| 753 | Requires: glib-2.0 |
---|
| 754 | Version: $BITLBEE_VERSION |
---|
| 755 | Libs: |
---|
| 756 | Cflags: -I\${includedir} |
---|
| 757 | |
---|
| 758 | EOF |
---|
| 759 | |
---|
[b7d3cc34] | 760 | protocols='' |
---|
| 761 | protoobjs='' |
---|
| 762 | |
---|
[e248c7f] | 763 | if [ "$purple" = 0 ]; then |
---|
| 764 | echo '#undef WITH_PURPLE' >> config.h |
---|
| 765 | else |
---|
[e08e53c] | 766 | if ! $PKG_CONFIG purple; then |
---|
| 767 | echo |
---|
| 768 | echo 'Cannot find libpurple development libraries, aborting. (Install libpurple-dev?)' |
---|
| 769 | exit 1 |
---|
| 770 | fi |
---|
[e248c7f] | 771 | echo '#define WITH_PURPLE' >> config.h |
---|
[b95b0c8] | 772 | cat<<EOF >>Makefile.settings |
---|
[e08e53c] | 773 | EFLAGS += $($PKG_CONFIG purple --libs) |
---|
| 774 | PURPLE_CFLAGS += $($PKG_CONFIG purple --cflags) |
---|
| 775 | EOF |
---|
[e248c7f] | 776 | protocols=$protocols'purple ' |
---|
| 777 | protoobjs=$protoobjs'purple_mod.o ' |
---|
| 778 | |
---|
[04e2a05] | 779 | # only disable these if the user didn't enable them explicitly |
---|
| 780 | [ "$msn" = "default-on" ] && msn=0 |
---|
| 781 | [ "$jabber" = "default-on" ] && jabber=0 |
---|
| 782 | [ "$oscar" = "default-on" ] && oscar=0 |
---|
| 783 | [ "$yahoo" = "default-on" ] && yahoo=0 |
---|
[18e1f3b] | 784 | |
---|
| 785 | echo '#undef PACKAGE' >> config.h |
---|
| 786 | echo '#define PACKAGE "BitlBee-LIBPURPLE"' >> config.h |
---|
[bda2975] | 787 | |
---|
| 788 | if [ "$events" = "libevent" ]; then |
---|
| 789 | echo 'Warning: Some libpurple modules (including msn-pecan) do their event handling' |
---|
| 790 | echo 'outside libpurple, talking to GLib directly. At least for now the combination' |
---|
| 791 | echo 'libpurple + libevent is *not* recommended!' |
---|
[c775a58] | 792 | echo |
---|
[bda2975] | 793 | fi |
---|
[e248c7f] | 794 | fi |
---|
| 795 | |
---|
[b0a89cc] | 796 | case "$CC" in |
---|
| 797 | *gcc* ) |
---|
[e371011] | 798 | echo CFLAGS+=-MMD -MF .depend/\$@.d >> Makefile.settings |
---|
[fe92921] | 799 | for i in . lib tests protocols protocols/*/; do |
---|
[b0a89cc] | 800 | mkdir -p $i/.depend |
---|
| 801 | done |
---|
| 802 | esac |
---|
| 803 | |
---|
[b7d3cc34] | 804 | if [ "$msn" = 0 ]; then |
---|
| 805 | echo '#undef WITH_MSN' >> config.h |
---|
| 806 | else |
---|
| 807 | echo '#define WITH_MSN' >> config.h |
---|
| 808 | protocols=$protocols'msn ' |
---|
[b5a22e3] | 809 | protoobjs=$protoobjs'msn_mod.o ' |
---|
[b7d3cc34] | 810 | fi |
---|
| 811 | |
---|
| 812 | if [ "$jabber" = 0 ]; then |
---|
| 813 | echo '#undef WITH_JABBER' >> config.h |
---|
| 814 | else |
---|
| 815 | echo '#define WITH_JABBER' >> config.h |
---|
| 816 | protocols=$protocols'jabber ' |
---|
[b5a22e3] | 817 | protoobjs=$protoobjs'jabber_mod.o ' |
---|
[b7d3cc34] | 818 | fi |
---|
| 819 | |
---|
| 820 | if [ "$oscar" = 0 ]; then |
---|
| 821 | echo '#undef WITH_OSCAR' >> config.h |
---|
| 822 | else |
---|
| 823 | echo '#define WITH_OSCAR' >> config.h |
---|
| 824 | protocols=$protocols'oscar ' |
---|
[b5a22e3] | 825 | protoobjs=$protoobjs'oscar_mod.o ' |
---|
[b7d3cc34] | 826 | fi |
---|
| 827 | |
---|
| 828 | if [ "$yahoo" = 0 ]; then |
---|
| 829 | echo '#undef WITH_YAHOO' >> config.h |
---|
| 830 | else |
---|
| 831 | echo '#define WITH_YAHOO' >> config.h |
---|
| 832 | protocols=$protocols'yahoo ' |
---|
[b5a22e3] | 833 | protoobjs=$protoobjs'yahoo_mod.o ' |
---|
[b7d3cc34] | 834 | fi |
---|
| 835 | |
---|
[1b221e0] | 836 | if [ "$twitter" = 0 ]; then |
---|
| 837 | echo '#undef WITH_TWITTER' >> config.h |
---|
| 838 | else |
---|
| 839 | echo '#define WITH_TWITTER' >> config.h |
---|
| 840 | protocols=$protocols'twitter ' |
---|
| 841 | protoobjs=$protoobjs'twitter_mod.o ' |
---|
| 842 | fi |
---|
| 843 | |
---|
[3434a8c] | 844 | if [ "$rpc" = 0 ]; then |
---|
| 845 | echo '#undef WITH_RPC' >> config.h |
---|
| 846 | else |
---|
| 847 | echo '#define WITH_RPC' >> config.h |
---|
| 848 | protocols=$protocols'rpc ' |
---|
| 849 | protoobjs=$protoobjs'rpc_mod.o ' |
---|
| 850 | fi |
---|
| 851 | |
---|
[b7d3cc34] | 852 | if [ "$protocols" = "PROTOCOLS = " ]; then |
---|
[43462708] | 853 | echo "Warning: You haven't selected any communication protocol to compile!" |
---|
[b3c467b] | 854 | echo " BitlBee will run, but you will be unable to connect to IM servers!" |
---|
[b7d3cc34] | 855 | fi |
---|
| 856 | |
---|
| 857 | echo "PROTOCOLS = $protocols" >> Makefile.settings |
---|
| 858 | echo "PROTOOBJS = $protoobjs" >> Makefile.settings |
---|
| 859 | |
---|
| 860 | echo Architecture: $arch |
---|
| 861 | case "$arch" in |
---|
| 862 | Linux ) |
---|
| 863 | ;; |
---|
| 864 | GNU/* ) |
---|
| 865 | ;; |
---|
| 866 | *BSD ) |
---|
| 867 | ;; |
---|
| 868 | Darwin ) |
---|
[caceb06] | 869 | echo 'STRIP=\# skip strip' >> Makefile.settings |
---|
[b7d3cc34] | 870 | ;; |
---|
| 871 | IRIX ) |
---|
| 872 | ;; |
---|
| 873 | SunOS ) |
---|
| 874 | echo 'EFLAGS+=-lresolv -lnsl -lsocket' >> Makefile.settings |
---|
| 875 | echo 'STRIP=\# skip strip' >> Makefile.settings |
---|
[70d7795] | 876 | echo '#define NO_FD_PASSING' >> config.h |
---|
[b7d3cc34] | 877 | ;; |
---|
[8de63c3] | 878 | AIX ) |
---|
| 879 | echo 'EFLAGS+=-Wl,-brtl' >> Makefile.settings |
---|
[b7d3cc34] | 880 | ;; |
---|
| 881 | CYGWIN* ) |
---|
| 882 | ;; |
---|
[aec56b0] | 883 | Windows ) |
---|
[e252d8c] | 884 | echo 'Native windows compilation is not supported anymore, use cygwin instead.' |
---|
[aec56b0] | 885 | ;; |
---|
[b7d3cc34] | 886 | * ) |
---|
[8d6c4b1] | 887 | echo 'We haven'\''t tested BitlBee on many platforms yet, yours is untested. YMMV.' |
---|
| 888 | echo 'Please report any problems at http://bugs.bitlbee.org/.' |
---|
[b7d3cc34] | 889 | ;; |
---|
| 890 | esac |
---|
| 891 | |
---|
[f1e7407] | 892 | if [ -n "$target" ]; then |
---|
| 893 | echo "Cross-compiling for: $target" |
---|
| 894 | fi |
---|
| 895 | |
---|
[b7d3cc34] | 896 | echo |
---|
| 897 | echo 'Configuration done:' |
---|
| 898 | |
---|
| 899 | if [ "$debug" = "1" ]; then |
---|
[b3c467b] | 900 | echo ' Debugging enabled.' |
---|
[b7d3cc34] | 901 | else |
---|
[b3c467b] | 902 | echo ' Debugging disabled.' |
---|
[b7d3cc34] | 903 | fi |
---|
| 904 | |
---|
[e2472dd] | 905 | if [ "$asan" = "1" ]; then |
---|
| 906 | echo ' AddressSanitizer (ASAN) enabled.' |
---|
| 907 | else |
---|
| 908 | echo ' AddressSanitizer (ASAN) disabled.' |
---|
| 909 | fi |
---|
| 910 | |
---|
[7281ad1] | 911 | if [ "$pie" = "1" ]; then |
---|
| 912 | echo ' Building PIE executable' |
---|
| 913 | else |
---|
| 914 | echo ' Building non-PIE executable' |
---|
| 915 | fi |
---|
| 916 | |
---|
[b7d3cc34] | 917 | if [ "$strip" = "1" ]; then |
---|
[b3c467b] | 918 | echo ' Binary stripping enabled.' |
---|
[b7d3cc34] | 919 | else |
---|
[b3c467b] | 920 | echo ' Binary stripping disabled.' |
---|
[b7d3cc34] | 921 | fi |
---|
| 922 | |
---|
[764c7d1] | 923 | if [ "$otr" = "1" ]; then |
---|
| 924 | echo ' Off-the-Record (OTR) Messaging enabled.' |
---|
[858ea01] | 925 | elif [ "$otr" = "plugin" ]; then |
---|
| 926 | echo ' Off-the-Record (OTR) Messaging enabled (as a plugin).' |
---|
[764c7d1] | 927 | else |
---|
| 928 | echo ' Off-the-Record (OTR) Messaging disabled.' |
---|
| 929 | fi |
---|
| 930 | |
---|
[417002e] | 931 | if [ -n "$systemdsystemunitdir" ]; then |
---|
| 932 | echo ' systemd enabled.' |
---|
| 933 | else |
---|
| 934 | echo ' systemd disabled.' |
---|
| 935 | fi |
---|
| 936 | |
---|
[b3c467b] | 937 | echo ' Using event handler: '$events |
---|
| 938 | echo ' Using SSL library: '$ssl |
---|
[b7d3cc34] | 939 | |
---|
| 940 | if [ -n "$protocols" ]; then |
---|
[17f6079] | 941 | echo ' Building with these protocols:' $protocols$protocols_mods |
---|
[4e3df8a] | 942 | case "$protocols" in |
---|
| 943 | *purple*) |
---|
| 944 | echo " Note that BitlBee-libpurple is supported on a best-effort basis. It's" |
---|
| 945 | echo " not *fully* compatible with normal BitlBee. Don't use it unless you" |
---|
| 946 | echo " absolutely need it (i.e. support for a certain protocol or feature)." |
---|
| 947 | esac |
---|
[b7d3cc34] | 948 | else |
---|
[b3c467b] | 949 | echo ' Building without IM-protocol support. We wish you a lot of fun...' |
---|
[b7d3cc34] | 950 | fi |
---|