File: configure.ac

package info (click to toggle)
pidgin-sipe 1.9.0-1.1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 2,864 kB
  • ctags: 1,419
  • sloc: ansic: 17,010; sh: 10,355; objc: 288; makefile: 144
file content (306 lines) | stat: -rw-r--r-- 8,085 bytes parent folder | download
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
dnl Use `VERSION' files to get version.
m4_define([SIPE_VERSION_DATA], m4_include([VERSION]))

dnl Strip off newline characters.
m4_define([_SIPE_VERSION],
          m4_substr(SIPE_VERSION_DATA,
                    [0], m4_decr(m4_len(SIPE_VERSION_DATA))))

dnl version of this package
m4_define(pidgin_sipe_version, _SIPE_VERSION)

AC_INIT([pidgin-sipe], _SIPE_VERSION)
AC_DEFINE(SIPE_VERSION, "_SIPE_VERSION", [Define sipe version.])

AC_PREREQ([2.50])
AM_INIT_AUTOMAKE([1.9 dist-bzip2 tar-ustar])

AC_DISABLE_STATIC

AC_PROG_CC
IT_PROG_INTLTOOL([0.35.0])
AC_PROG_LIBTOOL
AC_PROG_INSTALL

AC_HEADER_STDC

dnl checks for library functions
AC_CHECK_FUNCS([setenv unsetenv])

dnl tell pkgconfig to look in the same prefix we're installing this to,
dnl as that's likely where libpurple will be found if it's not in the default
dnl pkgconfig path
PREFIX=$ac_default_prefix
if test "$prefix" != "NONE"; then
	PREFIX=$prefix
fi

PKG_CONFIG_PATH="$PKG_CONFIG_PATH":"$PREFIX/lib/pkgconfig"
export PKG_CONFIG_PATH

dnl debug mode
AC_ARG_ENABLE(debug,
	[AS_HELP_STRING([--enable-debug],
			[compile with debugging support [default=no]])],
	,
	enable_debug="no")

if test "$enable_debug" = yes; then
   AC_DEFINE(DEBUG, 1, [Define if debugging is enabled.])
fi

DEBUG_CFLAGS="${DEBUG_CFLAGS}"
AC_SUBST(DEBUG_CFLAGS)

dnl quality check mode
dnl For people who are interested in finding bugs and not hiding them
AC_ARG_ENABLE(quality-check,
	[AS_HELP_STRING([--enable-quality-check],
			[compile with compiler checks enabled [default=yes]])],
	,
	enable_quality_check="yes")

if test "$enable_quality_check" = yes; then
	QUALITY_CFLAGS="${QUALITY_CFLAGS} -Werror -Wall -Wextra"
else
	QUALITY_CFLAGS="${QUALITY_CFLAGS}"
fi
AC_SUBST(QUALITY_CFLAGS)

dnl Check for pkg-config before using it
PKG_PROG_PKG_CONFIG

AC_ARG_WITH([krb5],
	[AC_HELP_STRING([--with-krb5=PREFIX],
		[compile sipe plugin with Kerberos 5 support @<:@default=no@:>@])],
	[test "$withval" = "no" || kerberos="$withval"],
	[kerberos="no"])

dnl check for Kerberos
AC_SUBST(KRB5_CFLAGS)
AC_SUBST(KRB5_LDFLAGS)
AC_SUBST(KRB5_LIBS)

AM_CONDITIONAL(SIP_SEC_KRB5, test "$kerberos" != "no")
if test "$kerberos" != "no" ; then
        if test "$kerberos" != "yes" ; then
                KRB5_CFLAGS="-I${kerberos}/include"
                KRB5_LDFLAGS="-L${kerberos}/lib"
        fi
        orig_LDFLAGS="$LDFLAGS"
        LDFLAGS="$LDFLAGS $KRB5_LDFLAGS"
        AC_CHECK_LIB(krb5, krb5_rd_req,
                        [KRB5_LIBS="-lkrb5"],
                        [AC_CHECK_LIB(krb5, krb5_rd_req,
                                [KRB5_LIBS="-lkrb5"],
                                [AC_ERROR(Kerberos 5 libraries not found)],
                                )],
                        -lkrb5)
        AC_CHECK_LIB(gssapi_krb5, gss_krb5_export_lucid_sec_context,
                        [KRB5_LIBS="$KRB5_LIBS -lgssapi_krb5"],
                        [AC_CHECK_LIB(gssapi, gss_krb5_export_lucid_sec_context,
                                [KRB5_LIBS="$KRB5_LIBS -lgssapi_krb5"],
                                [AC_ERROR(GSSAPI libraries not found)],
                                )],
                        -lgssapi_krb5)
	savedLIBS="$LIBS"
	LIBS="$KRB5_LIBS $LIBS"
	AC_CHECK_FUNCS([krb5_get_error_message])
	LIBS="$savedLIBS"
	AC_DEFINE(USE_KERBEROS, 1, [Define if kerberos should be used in sipe.])
fi

dnl check for glib
PKG_CHECK_MODULES(GLIB, [glib-2.0])

dnl assumption check: sizof(uuid_t) must be 16 (see uuid.c)
AC_MSG_CHECKING([that sizeof(uuid_t) is 16])
ac_save_CFLAGS=$CFLAGS
CFLAGS="$GLIB_CFLAGS -Werror -Wall -Wextra"
dnl note the [[[ quoting: our code contains []!
AC_RUN_IFELSE(
	AC_LANG_PROGRAM(
		[[[
#include <glib.h>
#include <stdio.h>

/* Copied from uuid.c */
typedef struct {
   guint32 time_low;
   guint16 time_mid;
   guint16 time_hi_and_version;
   guint8  clock_seq_hi_and_reserved;
   guint8  clock_seq_low;
   guint8  node[6];
} uuid_t;
		]]],
		[return(sizeof(uuid_t) == 16 ? 0 : 1);]),
	[AC_MSG_RESULT(yes)],
	[AC_MSG_RESULT(failed)
	 AC_ERROR(sizeof(uuid_t) is not 16

Please notify the SIPE developers and provide the following information:

 host:     $host
 build:    $build
 compiler: $CC
)])
CFLAGS=$ac_save_CFLAGS

dnl check for libpurple
purple="yes"
AC_ARG_WITH([purple],
	[AC_HELP_STRING([--with-purple],
		[compile sipe plugin for libpurple clients @<:@default=autodetect@:>@])],
	[test "$withval" = "yes" || purple="no"],
	[])
if test "$purple" != "no"; then
	PKG_CHECK_MODULES(PURPLE, [purple >= 2.4.0],
		[],
		[purple="no"])
fi

dnl support for libpurple plugin
AM_CONDITIONAL(SIPE_INCLUDE_PURPLE, test "$purple" != "no")
if test "$purple" != "no"; then

	dnl unfortunately PURPLE_MAJOR_VERSION is not exported by purple.m4
	PURPLE_MAJOR_VERSION=`$PKG_CONFIG --modversion purple | cut -d. -f 1`
	AC_SUBST(PURPLE_MAJOR_VERSION)

	dnl let user now if he has a 32- and 64-bit header conflict...
	AC_MSG_CHECKING([for 32- and 64-bit header conflicts])
	ac_save_CFLAGS=$CFLAGS
	CFLAGS="$PURPLE_CFLAGS -Werror -Wall -Wextra"
	AC_COMPILE_IFELSE(
		AC_LANG_PROGRAM(
			[
#include <glib.h>
#include <cipher.h>

/* Compile some code that has caused trouble in the past */
void testfunc(unsigned long len)
{
  PurpleCipherContext *rc4 = NULL;
  purple_cipher_context_set_option(rc4, "key_len", GUINT_TO_POINTER(len));
}
			],
			[testfunc(16);]),
		[AC_MSG_RESULT(none)],
		[AC_MSG_RESULT(failed)
		 AC_ERROR(conflicts found.

Check that you have the correct glib/libpurple headers installed for
your architecture or set PURPLE_CFLAGS to override the system defaults.
)])
	CFLAGS=$ac_save_CFLAGS
fi

dnl check for telepathy
telepathy="yes"
AC_ARG_WITH([telepathy],
	[AC_HELP_STRING([--with-telepathy],
		[compile sipe plugin for telepathy clients @<:@default=autodetect@:>@])],
	[test "$withval" = "yes" || telepathy="no"],
	[])
if test "$telepathy" != "no"; then
	PKG_CHECK_MODULES(TELEPATHY, [telepathy-glib],
		[],
		[telepathy="no"])
fi

dnl support for telepathy plugin
AM_CONDITIONAL(SIPE_INCLUDE_TELEPATHY, test "$telepathy" != "no")
dnl NOTHING IMPLEMENTED YET!!!
dnl if test "$telepathy" != "no"; then
dnl fi

dnl sanity check
AS_IF([test "$purple" = "no" -a "$telepathy" = "no"],
	[AC_ERROR(at least one plugin must be selected

If you didn't use a --without option then please check that you have
the headers for the packages "purple" or "telepathy-glib" installed.
)],
	[])

dnl i18n
AC_MSG_CHECKING([locale_CPPFLAGS])
LOCALE_CPPFLAGS='-DLOCALEDIR=\"$(prefix)/$(DATADIRNAME)/locale\"'
AC_SUBST([LOCALE_CPPFLAGS])
AC_MSG_RESULT([$LOCALE_CPPFLAGS])

GETTEXT_PACKAGE=$PACKAGE
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Gettext Package])
AM_GLIB_GNU_GETTEXT

dnl codeset
AM_LANGINFO_CODESET

dnl substitutions and generated files
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([
	Makefile
	pixmaps/Makefile
	m4macros/Makefile
	po/Makefile.in
	pixmaps/16/Makefile
	pixmaps/22/Makefile
	pixmaps/48/Makefile
	src/Makefile
	src/core/Makefile
	src/api/Makefile
	src/purple/Makefile
	src/telepathy/Makefile
	])

dnl generate files
AC_OUTPUT()

dnl additional info for the user
echo
if test "$purple" != "no" ; then
	echo "Compiling libpurple plugin"
	echo "PURPLE_CFLAGS  : $PURPLE_CFLAGS"
	echo "PURPLE_LIBS    : $PURPLE_LIBS"
else
	echo "Skipping libpurple plugin"
fi

echo
if test "$telepathy" != "no" ; then
	echo "Compiling telepathy plugin"
	echo
	echo "NOTHING IMPLEMENTED YET!!!"
	echo
	echo "TELEPATHY_CFLAGS: $TELEPATHY_CFLAGS"
	echo "TELEPATHY_LIBS  : $TELEPATHY_LIBS"
else
	echo "Skipping telepathy plugin"
fi
if test "$kerberos" != "no" ; then
	echo
	echo "Compiling with kerberos 5 support"
	echo "KRB5_CFLAGS    : $KRB5_CFLAGS"
	echo "KRB5_LDFLAGS   : $KRB5_LDFLAGS"
	echo "KRB5_LIBS      : $KRB5_LIBS"
fi

if test "$enable_debug" != "no"; then
	echo
	echo "Compiling with debugging enabled"
	echo "DEBUG_CFLAGS   : $DEBUG_CFLAGS"
fi

if test -n "${QUALITY_CFLAGS}"; then
	echo
	echo "Compiling with compiler checks enabled"
	echo "QUALITY_CFLAGS : $QUALITY_CFLAGS"
fi

echo
echo "configure complete, now run 'make'"
echo

dnl The End.