aboutsummaryrefslogtreecommitdiffstats
path: root/skype/configure.ac
blob: f04a8e7c22ff9388828b7e927fbf702fb9f40100 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
AC_INIT([Skype plugin for BitlBee], 1.0, [vmiklos@vmiklos.hu], bitlbee-skype)
AC_PROG_CC
AC_PROG_INSTALL

AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug], [Enable debug support (default: disabled)]), debug=yes)
AC_MSG_CHECKING(for debug mode request)
if test "x$debug" = "xyes" ; then
	CFLAGS="-g -Wall -Werror"
	AC_MSG_RESULT(yes)
else
	AC_MSG_RESULT(no)
fi

case "`$CC -dumpmachine`" in
	*linux*|*freebsd*)
		SHARED_FLAGS="-fPIC -shared"
		SHARED_EXT="so"
		;;
	*apple-darwin*)
		SHARED_FLAGS="-dynamiclib -undefined dynamic_lookup"
		SHARED_EXT="dylib"
		;;
	*)
		AC_MSG_ERROR([Your machine is not yet supported])
		;;
esac
AC_SUBST(SHARED_FLAGS)
AC_SUBST(SHARED_EXT)

dnl Check for bitlbee
AC_MSG_CHECKING(for BitlBee)
if test -d /usr/local/lib/pkgconfig; then
	PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
	export PKG_CONFIG_PATH
fi
pkg-config --exists bitlbee
if test "$?" != "0"; then
	AC_MSG_RESULT(no)
	BITLBEE="no"
else
	AC_MSG_RESULT(yes)
	BITLBEE="yes"
	if test -z "$CFLAGS"; then
		CFLAGS="`pkg-config --cflags bitlbee`"
	else
		CFLAGS="$CFLAGS `pkg-config --cflags bitlbee`"
	fi
	if test -z "$LDFLAGS"; then
		LDFLAGS="`pkg-config --libs bitlbee`"
	else
		LDFLAGS="$LDFLAGS `pkg-config --libs bitlbee`"
	fi
	prefix=`pkg-config --variable=prefix bitlbee`
fi
AC_SUBST(BITLBEE)

dnl Check for a2x
AC_ARG_ENABLE([asciidoc], AS_HELP_STRING([--disable-asciidoc], [Disable asciidoc support (default: test)]))
if test "$enable_asciidoc" != "no"; then
	AC_CHECK_PROG(ASCIIDOC, asciidoc, yes, [])
fi

dnl Check for Skype4Py
AC_MSG_CHECKING(for Python module Skype4Py)
python -c "import Skype4Py" 2>&AS_MESSAGE_LOG_FD
if test "$?" != "0"; then
	AC_MSG_RESULT(no)
	SKYPE4PY="no"
else
	AC_MSG_RESULT(yes)
	SKYPE4PY="yes"
fi
AC_SUBST(SKYPE4PY)

if test "$BITLBEE" = "no" -a "$SKYPE4PY" = "no"; then
	AC_ERROR([In order to use bitlbee-skype you need at least BitlBee or Skype4Py installed.])
fi

AC_OUTPUT(config.mak)
AC_OUTPUT(skyped.conf.dist)

echo "
	BitlBee plugin:                 $BITLBEE
	skyped:                         $SKYPE4PY
	prefix:				$prefix
	install program:		$INSTALL"
if test "$BITLBEE" = "yes"; then
	echo "	compiler flags:			$CFLAGS
	linker flags:			$LDFLAGS
	shared object flags:		$SHARED_FLAGS
	shared object extension:	$SHARED_EXT"
fi
if test "$SKYPE4PY" = "yes"; then
	echo "	sysconfig dir:			$sysconfdir/skyped"
fi
echo