1 | AC_INIT([Bitlbee Python plugin], 0.1, [https://github.com/flexo/minecraftswitch/issues], bitlbee-python, [https://github.com/flexo/minecraftswitch]) |
---|
2 | AC_MSG_NOTICE([Configuring bitlbee-python...]) |
---|
3 | |
---|
4 | AC_PROG_CC |
---|
5 | AC_PROG_INSTALL |
---|
6 | |
---|
7 | AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug], [Enable debug support (default: disabled)]), debug=yes) |
---|
8 | AC_MSG_CHECKING(for debug mode request) |
---|
9 | if test "x$debug" = "xyes" ; then |
---|
10 | CFLAGS="-g -Wall -Werror" |
---|
11 | AC_MSG_RESULT(yes) |
---|
12 | else |
---|
13 | AC_MSG_RESULT(no) |
---|
14 | fi |
---|
15 | |
---|
16 | dnl Check for bitlbee |
---|
17 | AC_MSG_CHECKING(for BitlBee) |
---|
18 | if test -d /usr/local/lib/pkgconfig; then |
---|
19 | PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig |
---|
20 | export PKG_CONFIG_PATH |
---|
21 | fi |
---|
22 | pkg-config --exists bitlbee |
---|
23 | if test "$?" != "0"; then |
---|
24 | AC_MSG_RESULT(no) |
---|
25 | BITLBEE="no" |
---|
26 | else |
---|
27 | AC_MSG_RESULT(yes) |
---|
28 | BITLBEE="yes" |
---|
29 | fi |
---|
30 | |
---|
31 | if test "$BITLBEE" = "no"; then |
---|
32 | AC_ERROR([In order to use bitlbee-python you need BitlBee installed.]) |
---|
33 | fi |
---|
34 | |
---|
35 | if test -z "$CFLAGS"; then |
---|
36 | CFLAGS="`pkg-config --cflags bitlbee` `python-config --cflags`" |
---|
37 | else |
---|
38 | CFLAGS="$CFLAGS `pkg-config --cflags bitlbee` `python-config --cflags`" |
---|
39 | fi |
---|
40 | if test -z "$LDFLAGS"; then |
---|
41 | LDFLAGS="`pkg-config --libs bitlbee` `python-config --ldflags`" |
---|
42 | else |
---|
43 | LDFLAGS="$LDFLAGS `pkg-config --libs bitlbee` `python-config --ldflags`" |
---|
44 | fi |
---|
45 | prefix=`pkg-config --variable=prefix bitlbee` |
---|
46 | |
---|
47 | case "`$CC -dumpmachine`" in |
---|
48 | *linux*|*freebsd*|*netbsd*|*openbsd*) |
---|
49 | SHARED_FLAGS="-fPIC -shared" |
---|
50 | SHARED_EXT="so" |
---|
51 | ;; |
---|
52 | *apple-darwin*) |
---|
53 | SHARED_FLAGS="-dynamiclib -undefined dynamic_lookup" |
---|
54 | SHARED_EXT="dylib" |
---|
55 | ;; |
---|
56 | *) |
---|
57 | AC_MSG_ERROR([Your machine is not yet supported]) |
---|
58 | ;; |
---|
59 | esac |
---|
60 | AC_SUBST(SHARED_FLAGS) |
---|
61 | AC_SUBST(SHARED_EXT) |
---|
62 | |
---|
63 | AC_OUTPUT(Makefile) |
---|
64 | AC_OUTPUT(config.mak) |
---|
65 | cp confdefs.h config.h |
---|
66 | |
---|
67 | echo " |
---|
68 | BitlBee plugin: $BITLBEE |
---|
69 | prefix: $prefix |
---|
70 | install program: $INSTALL |
---|
71 | compiler flags: $CFLAGS |
---|
72 | linker flags: $LDFLAGS |
---|
73 | shared object flags: $SHARED_FLAGS |
---|
74 | shared object extension: $SHARED_EXT" |
---|
75 | echo |
---|