1# $Id: configure.in,v 1.134 2006/07/16 22:16:56 krzyzak Exp $
2
3m4_define([gg2_version],[2.3.0])
4
5AC_INIT(gg2,[gg2_version])
6AM_INIT_AUTOMAKE([gg2],[gg2_version])
7AM_CONFIG_HEADER(config.h)
8AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
9AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
10AC_SUBST(PACKAGE)
11AC_SUBST(VERSION)
12
13GTK_MIN_VER="2.4.0"
14
15GETTEXT_PACKAGE=$PACKAGE
16AC_SUBST(GETTEXT_PACKAGE)
17AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE")
18
19if test `uname -s` = "Linux"; then
20 	AC_DEFINE_UNQUOTED(OS_NAME,"`uname -o`")
21else
22	AC_DEFINE_UNQUOTED(OS_NAME,"`uname -sr`")
23fi
24
25if test `uname -s` = "Darwin"; then
26 	AC_DEFINE_UNQUOTED(LIB_SUFFIX,"")
27else
28	AC_DEFINE_UNQUOTED(LIB_SUFFIX,"so")
29fi
30
31AC_PROG_CPP
32AC_PROG_CC
33AC_PROG_INSTALL
34AC_PROG_LN_S
35
36AC_DEFINE_UNQUOTED(INSTALLPREFIX, "${prefix}")
37
38AC_PATH_PROG(GMAKE, gmake, no)
39
40if test "x$GMAKE" = "xno"; then
41	AC_PATH_PROG(MAKE, make, no)
42
43	if test "x$MAKE" = "xno"; then
44		AC_MSG_ERROR([make ])
45	fi
46else
47	MAKE="$GMAKE"
48fi
49
50AC_DISABLE_STATIC
51AC_LIBTOOL_DLOPEN
52AM_PROG_LIBTOOL
53AC_SUBST(LIBTOOL_DEPS)
54AC_PROG_MAKE_SET
55AC_PROG_AWK
56
57LIBTOOL="$LIBTOOL --silent"
58
59AC_HEADER_STDC
60AC_STDC_HEADERS
61
62AC_C_CONST
63AC_STRUCT_TM
64AC_C_BIGENDIAN
65
66AC_MSG_CHECKING([for long long])
67AC_TRY_COMPILE([],
68[
69	long long a = 1LL;
70	unsigned long long b = 1LL;
71], [
72	AC_MSG_RESULT([yes])
73	AC_DEFINE([HAVE_LONG_LONG])
74])
75
76AC_MSG_CHECKING([for va_copy])
77AC_TRY_LINK([#include <stdarg.h>], [va_list a, b; va_copy(a, b);],
78[
79	AC_MSG_RESULT([yes])
80	AC_DEFINE([HAVE_VA_COPY])
81], [
82	AC_MSG_RESULT([no])
83])
84
85AC_MSG_CHECKING([for __va_copy])
86AC_TRY_LINK([#include <stdarg.h>], [va_list a, b; __va_copy(a, b);],
87[
88	AC_MSG_RESULT([yes])
89	AC_DEFINE([HAVE___VA_COPY])
90], [
91	AC_MSG_RESULT([no])
92])
93
94AC_ARG_WITH(c99-vsnprintf,
95  [  --with-c99-vsnprintf    Target system has C99-compatible vsnprintf()])
96
97if test "x$with_c99_vsnprintf" = "xyes"; then
98	AC_DEFINE([HAVE_C99_VSNPRINTF])
99fi
100
101if test "x$with_c99_vsnprintf" = "x"; then
102	AC_MSG_CHECKING([for C99-compatible vsnprintf()])
103	AC_TRY_RUN(
104	[
105		#include <stdio.h>
106		int main()
107		{
108			char tmp;
109			return (snprintf(&tmp, sizeof(tmp), "test") != 4);
110		}
111	], [
112		AC_MSG_RESULT([yes])
113		AC_DEFINE([HAVE_C99_VSNPRINTF])
114	], [
115		AC_MSG_RESULT([no])
116	])
117fi
118
119#
120#  Resolver libgadu oparty na pthread
121#
122
123ACX_PTHREAD(
124[
125 	# workaround dla pkconfiga
126	if test "x$PTHREAD_CFLAGS" = "x-pthread"; then
127		PTHREAD_LIBS="$PTHREAD_LIBS -pthread"
128	fi
129
130	LIBS="$PTHREAD_LIBS $LIBS"
131	CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
132	CFLAGS_LIBGADU="$CFLAGS_LIBGADU $PTHREAD_CFLAGS"
133	CC="$PTHREAD_CC"
134
135	have_pthread=yes
136
137	AC_DEFINE([HAVE_PTHREAD])
138	], [
139	AC_MSG_ERROR([Your system is not supporting pthreads])
140])
141
142
143# AC_CHECK_HEADERS(asm/byteorder.h byteswap.h endian.h machine/endian.h arpa/nameser_compat.h)
144# AC_CHECK_FUNCS(bswap_32 bswap_16)
145
146AC_TYPE_SIGNAL
147AC_FUNC_STRFTIME
148AC_FUNC_VPRINTF
149AC_CHECK_FUNCS([memset mkdir strcasecmp strchr strlen])
150
151# AM_PROG_LIBTOOL
152AM_MAINTAINER_MODE
153
154
155AC_CHECK_HEADERS(libintl.h)
156ALL_LINGUAS="pl nl"
157AM_GNU_GETTEXT([use-libtool])
158
159if test "x$GCC" = "xyes"; then
160   CFLAGS="$CFLAGS -Wall -Wno-uninitialized -Wchar-subscripts -Wnested-externs -Wpointer-arith -Wno-sign-compare"
161fi
162
163PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig"
164
165AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
166
167if test "x$PKG_CONFIG" = "xno"; then
168	AC_MSG_ERROR([pkgconfig ])
169fi
170
171PKG_CHECK_MODULES(GLIB,glib-2.0 >= 2.2.0,[
172   CFLAGS="$CFLAGS $GLIB_CFLAGS"
173   LDFLAGS="$LDFLAGS $GLIB_LIBS"
174    ],AC_MSG_ERROR($GLIB_PKG_ERRORS))
175
176PKG_CHECK_MODULES(GTHREAD,gthread-2.0 >= 2.2.0,[
177   CFLAGS="$CFLAGS $THREAD_CFLAGS"
178   LDFLAGS="$LDFLAGS $GTHREAD_LIBS"
179    ],AC_MSG_ERROR($GLIB_PKG_ERRORS))
180
181AC_ARG_ENABLE(debug, [  --enable-debug	  debug mode			default=disabled],
182    if test x$enableval = xyes; then
183	 with_debug=yes
184    else
185	if test "x$enableval" = xno; then
186		with_debug=no
187	else
188		with_debug=yes
189	fi
190    fi,
191    with_debug=no)
192
193if test x$with_debug = xyes; then
194  AC_DEFINE(GGADU_DEBUG)
195fi
196
197
198AC_ARG_ENABLE(gdb, [  --enable-gdb		  gdb support			default=disabled],
199    if test x$enableval = xyes; then
200	 with_gdb=yes
201    else
202	if test "x$enableval" = xno; then
203		with_gdb=no
204	else
205		with_gdb=yes
206	fi
207    fi,
208    with_gdb=no)
209
210
211if test x$with_gdb = xyes; then
212 CFLAGS="$CFLAGS -ggdb"
213fi
214
215# not working only for information
216
217# with_gui=yes
218# with_gghist=yes
219# with_gtkspell=yes
220# with_gadu=yes
221# with_tlen=yes
222# with_jabber=yes
223# with_xosd=yes
224# with_sms=yes
225# with_remote=yes
226# with_esd=yes
227# with_oss=yes
228# with_arts=yes
229# with_external=yes
230# with_external_libgadu=no
231# with_history_external_viewer=yes
232# with_update=yes
233# with_docklet_system_tray=yes
234# with_docklet_dockapp=yes
235# with_perl=no
236
237AC_ARG_WITH(all_plugins, [  --with-all-plugins	  Build all plugins with all features])
238if test x$with_all_plugins = xyes; then
239    with_gui=yes
240    with_gghist=yes
241    with_gtkspell=yes
242    with_gadu=yes
243    with_tlen=yes
244    with_jabber=yes
245    with_xosd=yes
246    with_esd=yes
247    with_oss=yes
248    with_arts=yes
249    with_sms=yes
250#    with_remote=yes
251    with_dbus=yes
252    with_aaway=yes
253    with_ignore=yes
254    with_external=yes
255    with_history_external_viewer=yes
256    with_update=yes
257    with_docklet_system_tray=yes
258    with_docklet_dockapp=yes
259#    with_perl=yes
260fi
261
262AC_ARG_WITH(perl, [  --with-perl		  perl support - experimental code])
263if test x$with_perl = xyes; then
264    AC_PATH_PROG(perlpath, perl)
265    AC_PATH_PROG(sedpath, sed)
266    AC_MSG_CHECKING(for Perl compile flags)
267    PERL_CFLAGS=`$perlpath -MExtUtils::Embed -e ccopts 2>/dev/null`
268    if test "_$PERL_CFLAGS" = "_"; then
269        AC_MSG_RESULT([not found, building without perl.])
270	with_perl=no
271    else
272	PERL_LDFLAGS=`$perlpath -MExtUtils::Embed -e ldopts`
273	AC_MSG_RESULT(ok)
274
275        oldLIBS=$LIBS
276        PERL_OPTION_LIBS="$LIBS $PERL_LDFLAGS"
277	AC_CHECK_FUNCS(eval_pv)
278        PERL_OPTION_LIBS=$oldLIBS
279        PERL_OPTION_CFLAGS="$CFLAGS $PERL_CFLAGS"
280        PERL_OPTION_LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
281        AC_DEFINE(PERL_EMBED)
282        AC_SUBST(PERL_OPTION_LIBS)
283        AC_SUBST(PERL_OPTION_CFLAGS)
284        AC_SUBST(PERL_OPTION_LDFLAGS)
285        CFLAGS="$CFLAGS $PERL_OPTION_CFLAGS"
286    fi
287else
288    with_perl=no
289fi
290
291# if test "x$with_perl" = "xyes"; then
292#       PERL_LDFLAGS=`$perlpath -MExtUtils::Embed -e ldopts |$sedpath 's/-lgdbm //'`
293#       PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-ldb //'`
294#       PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-lndbm //'`
295#       PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-lnsl //'`
296#       PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-lposix //'`
297#       PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-lc //'`
298# fi
299
300AC_ARG_WITH(gghist, [  --without-gghist		  Build without gghist])
301if test "x$with_gghist" != "xno"; then
302    with_gghist=yes
303    PKG_CHECK_MODULES(GTK,gtk+-2.0 >= 2.2.0,[],AC_MSG_ERROR($GTK_PKG_ERRORS))
304    AC_SUBST(GTK_CFLAGS)
305    AC_SUBST(GTK_LIBS)
306else
307    with_gghist=no
308fi
309
310AC_ARG_WITH(gui, [  --without-gui		  Build without gtk2 GUI plugin	])
311if test "x$with_gui" != "xno"; then
312    with_gui=yes
313    AC_PATH_X
314    AC_PATH_XTRA
315    PKG_CHECK_MODULES(GTK,gtk+-2.0 >= $GTK_MIN_VER,[],AC_MSG_ERROR($GTK_PKG_ERRORS))
316    GTK_CFLAGS="$GTK_CFLAGS $X_CFLAGS"
317    GTK_LIBS="$GTK_LIBS $X_LIBS"
318    AC_SUBST(GTK_CFLAGS)
319    AC_SUBST(GTK_LIBS)
320else
321    with_gui=no
322fi
323
324AC_ARG_WITH(gtkspell, [  --without-gtkspell	  Build without GUI plugin with gtkspell support])
325if test "x$with_gtkspell" != "xno"; then
326    with_gtkspell=yes
327    PKG_CHECK_MODULES(GTKSPELL,gtkspell-2.0 >= 2.0.0,[],with_gtkspell=no)
328    if test "$with_gtkspell" = "no"; then
329    	AC_MSG_ERROR([*** unable to find gtkspell (http://gtkspell.sourceforge.net), try to build --without-gtkspell ***])
330    fi
331    AC_PATH_PROG(pspell_config,pspell-config,"none")
332    if test "$pspell_config" = "none"; then
333    	AC_MSG_ERROR([*** unable to find pspell-config from aspell (http://aspell.net), try to build --without-gtkspell ***])
334    fi
335
336    AC_CHECK_HEADERS(aspell.h,have_aspellh=yes,have_aspellh=no)
337    if test "$have_aspellh" = no; then
338    	AC_MSG_ERROR([*** Unable to find aspell.h header file, try to build --without-gtkspell ***])
339    fi
340
341
342    AC_SUBST(GTKSPELL_CFLAGS)
343    AC_SUBST(GTKSPELL_LIBS)
344else
345    with_gtkspell=no
346fi
347
348AC_ARG_WITH(gadu, [  --without-gadu		  Build without gadu-gadu plugin])
349AC_ARG_WITH(external_libgadu, [  --with-external-libgadu	Build without gadu-gadu plugin with external libgadu])
350
351if test "x$with_external_libgadu" = "xyes"; then
352    PKG_CHECK_MODULES(LIBGADU,libgadu,with_external_libgadu=yes,AC_MSG_ERROR($GTK_PKG_ERRORS))
353    AC_SUBST(LIBGADU_CFLAGS)
354    AC_SUBST(LIBGADU_LIBS)
355else
356    with_external_libgadu=no
357fi
358
359AM_CONDITIONAL(EXTERNAL_LIBGADU, test "$with_external_libgadu" = "yes")
360
361#
362# GNU TLS Support
363#
364AC_ARG_WITH(gnutls, [  --with-gnutls	Build with gnutls		default=yes])
365
366if test "x$with_gadu" != "xno"; then
367    with_gadu=yes
368    if test "x$with_external_libgadu" = "xno"; then
369
370# GNUTLS
371if test "x$with_gnutls" != "xno"; then
372    with_gnutls=yes
373    AC_PATH_PROG(GNUTLS_CONFIG_SCRIPT, libgnutls-config, no)
374
375    if test "x$GNUTLS_CONFIG_SCRIPT" != "xno"; then
376	AC_CHECK_LIB([gnutls], [gnutls_init], with_gnutls=yes, with_gnutls=no, `$GNUTLS_CONFIG_SCRIPT --libs`)
377
378	if test "x$with_gnutls" != "xno"; then
379
380	    GNUTLS_CFLAGS=`$GNUTLS_CONFIG_SCRIPT --cflags`
381	    GNUTLS_LIBS=`$GNUTLS_CONFIG_SCRIPT --libs`
382
383	    AC_CHECK_HEADERS(gnutls/gnutls.h gnutls/openssl.h, have_gnutlsh=yes, have_gnutlsh=no)
384	    if test "$have_gnutlsh" = yes; then
385		with_gnutls=yes
386	        AC_SUBST(GNUTLS_LIBS)
387	        AC_SUBST(GNUTLS_CFLAGS)
388    	    else
389		with_gnutls=no
390    		AC_MSG_ERROR([*** unable to find gnutls/gnutls.h and gnutls/openssl.h headers ***])
391 	    fi
392	 fi
393    else
394    	AC_MSG_ERROR([*** unable to find GNUTLS library (http://www.gnu.org/software/gnutls/), try to build --without-gnutls ***])
395	with_gnutls=no
396    fi
397else
398    with_gnutls=no
399fi
400
401	AC_CONFIG_SUBDIRS([src/plugins/gadu_gadu/libgadu])
402
403    fi
404else
405    with_gadu=no
406fi
407
408AC_ARG_WITH(tlen, [  --without-tlen		  Build without tlen plugin])
409if test "x$with_tlen" != "xno"; then
410    with_tlen=yes
411    AC_CHECK_LIB([tlen], [tlen_set_hub_blocking], with_tlen=yes, with_tlen=no)
412    if test "x$with_tlen" != "xno"; then
413	AC_CHECK_HEADERS(libtlen/libtlen.h)
414	TLEN_LIBS="-ltlen -lm"
415	AC_SUBST(TLEN_LIBS)
416    else
417    	AC_MSG_ERROR([*** unable to find libtlen (http://www.libtlen.eu.org/), try to build --without-tlen ***])
418    fi
419else
420    with_tlen=no
421fi
422
423AC_ARG_WITH(jabber, [  --without-jabber		  Build without jabber plugin])
424if test "x$with_jabber" != "xno"; then
425    with_jabber=yes
426    PKG_CHECK_MODULES(JABBER,loudmouth-1.0 >= 0.17, [],with_jabber=no)
427    if test "$with_jabber" = "no"; then
428	echo
429	echo "**********************************************************"
430	echo
431	echo "Jabber plugin need loudmouth!"
432	echo "You don't have loudmouth installed (or you have wrong version)"
433	echo "Please download loudmouth: http://www.imendio.com/projects/loudmouth/"
434	echo
435	echo "Try to build --without-jabber"
436	echo
437	echo "**********************************************************"
438	echo
439    	AC_MSG_ERROR($JABBER_PKG_ERRORS)
440    fi
441
442    AC_CHECK_LIB([loudmouth-1],[lm_connection_set_jid],new_loudmouth=yes,new_loudmouth=no)
443
444    if test "x$new_loudmouth" != "xno"; then
445	AC_DEFINE(BUILD_WITH_NEW_LOUDMOUTH)
446    fi
447
448    AC_SUBST(JABBER_LIBS)
449    AC_SUBST(JABBER_CFLAGS)
450else
451    with_jabber=no
452fi
453
454AC_ARG_WITH(xosd, [  --without-xosd		  Build without XOSD plugin])
455if test "x$with_xosd" != "xno"; then
456    with_xosd=yes
457    AC_PATH_PROG(xosd_config_script, xosd-config, "none")
458
459    if test "x$xosd_config_script" != "xnone"; then
460	AC_CHECK_LIB([xosd], [xosd_display], with_xosd=yes, with_xosd=no, `$xosd_config_script --libs`)
461
462	if test "x$with_xosd" != "xno"; then
463
464	    XOSD_CFLAGS=`$xosd_config_script --cflags`
465	    XOSD_LIBS=`$xosd_config_script --libs`
466
467	    AC_CHECK_HEADERS(xosd.h)
468
469	    AC_SUBST(XOSD_LIBS)
470	    AC_SUBST(XOSD_CFLAGS)
471	fi
472    else
473    	AC_MSG_ERROR([*** unable to find XOSD library (http://www.ignavus.net/software.html), try to build --without-xosd ***])
474	with_xosd=no
475    fi
476else
477    with_xosd=no
478fi
479
480AC_ARG_WITH(sms, [  --without-sms		  Build without sms plugin])
481if test "x$with_sms" != "xno"; then
482	with_sms=yes
483	PKG_CHECK_MODULES(GTK,gtk+-2.0 >= $GTK_MIN_VER,[],AC_MSG_ERROR($GTK_PKG_ERRORS))
484    else
485	with_sms=no
486fi
487
488
489AC_ARG_WITH(aaway, [  --without-aaway		  Build without auto away plugin])
490if test "x$with_aaway" != "xno"; then
491	AC_PATH_X
492	AC_PATH_XTRA
493	AC_CHECK_HEADERS(X11/extensions/scrnsaver.h, have_scrnsaverh=yes, have_scrnsaverh=no)
494
495        if test "$have_scrnsaverh" = yes; then
496	    with_aaway=yes
497	else
498    	    AC_MSG_ERROR([*** unable to find X11/extensions/scrnsaver.h header, try to build --without-aaway ***])
499	fi
500
501	PKG_CHECK_MODULES(GTK,gtk+-2.0 >= $GTK_MIN_VER,[],AC_MSG_ERROR($GTK_PKG_ERRORS))
502	AAWAY_LIBS="$GTK_LIBS $X_LIBS $X_EXTRA_LIBS -lXss"
503	AAWAY_CFLAGS="$GTK_CFLAGS $X_CFLAGS"
504	AC_SUBST(AAWAY_CFLAGS)
505	AC_SUBST(AAWAY_LIBS)
506	AC_SUBST(GTK_CFLAGS)
507	AC_SUBST(GTK_LIBS)
508    else
509	with_aaway=no
510fi
511
512AC_ARG_WITH(ignore, [  --with-ignore		  Build without ignore plugin])
513if test "x$with_ignore" != "xno"; then
514	with_ignore=yes
515	AC_SUBST(IGNORE_CFLAGS)
516	AC_SUBST(IGNORE_LIBS)
517    else
518	with_ignore=no
519fi
520
521#AC_ARG_WITH(remote, [  --with-remote		  Build with remote plugin (deprecated)])
522#if test "x$with_remote" != "xyes"; then
523#	with_remote=no
524#else
525#	with_remote=yes
526#fi
527
528AC_ARG_WITH(dbus, [  --with-dbus		  Build with DBUS plugin])
529if test "x$with_dbus" != "xyes"; then
530	with_dbus=no
531else
532	with_dbus=yes
533	PKG_CHECK_MODULES(DBUS,dbus-1 dbus-glib-1, [], with_dbus=no)
534	if test "$with_dbus" = "no"; then
535	    AC_MSG_ERROR(DBUS_PKG_ERRORS)
536	fi
537
538	AC_SUBST(DBUS_CFLAGS)
539	AC_SUBST(DBUS_LIBS)
540fi
541AC_ARG_WITH(dbus-dir,[  --with-dbus-dir=DIR   Prefix where D-BUS services are installed (/usr/share/dbus-1/services)],
542            dbus_dir="$withval", dbus_dir="")
543
544if test x$dbus_dir != x ; then
545     DBUS_DIR="$dbus_dir/"
546else
547     DBUS_DIR="/usr/share/dbus-1/services/"
548fi
549
550AC_SUBST(DBUS_DIR)
551
552
553AC_ARG_WITH(docklet_system_tray, [  --without-docklet-system-tray	  Build without docklet plugin])
554if test "x$with_docklet_system_tray" != "xno"; then
555    with_docklet_system_tray=yes
556    PKG_CHECK_MODULES(GTK,gtk+-2.0 >= $GTK_MIN_VER, [], with_docklet_system_tray=no)
557    if test "$with_docklet_system_tray" = "no"; then
558    	AC_MSG_ERROR($GTK_PKG_ERRORS)
559    fi
560    AC_SUBST(GTK_CFLAGS)
561    AC_SUBST(GTK_LIBS)
562else
563    with_docklet_system_tray=no
564fi
565
566AC_ARG_WITH(docklet_dockapp, [  --without-docklet-dockapp	  Build without dockapp plugin])
567if test "x$with_docklet_dockapp" != "xno"; then
568    with_docklet_dockapp=yes
569    PKG_CHECK_MODULES(GTK,gtk+-2.0 >= $GTK_MIN_VER, [], with_docklet_dockapp=no)
570    if test "$with_docklet_dockapp" = "no"; then
571    	AC_MSG_ERROR($GTK_PKG_ERRORS)
572    fi
573    AC_SUBST(GTK_CFLAGS)
574    AC_SUBST(GTK_LIBS)
575else
576    with_docklet_dockapp=no
577fi
578
579AC_ARG_WITH(esd, [  --without-esd		  Build without esd sound plugin])
580if test "x$with_esd" != "xno"; then
581
582    with_esd=yes
583    have_libesd=no
584
585    AM_PATH_ESD(0.2.7 ,have_libesd=yes,[AC_MSG_ERROR([*** sound support for esd need EsounD installed http://www.tux.org/~ricdude/EsounD.html ***])])
586
587    if test "$have_libesd" = yes; then
588	AC_SUBST(ESD_CFLAGS)
589	AC_SUBST(ESD_LIBS)
590	with_esd=yes
591    else
592	with_esd=no
593    fi
594else
595    with_esd=no
596fi
597
598AC_ARG_WITH(arts, [  --without-arts		  Build without aRts! sound plugin])
599if test "x$with_arts" != "xno"; then
600    with_arts=yes
601
602    AC_PATH_PROG(ARTSC, artsc-config, no)
603    if test "x$ARTSC" = "xno"; then
604	AC_MSG_ERROR([*** sound support for aRts! - unable to find artsc-config ***])
605    fi
606
607    PKG_CHECK_MODULES(AUDIOFILE,audiofile >= 0.2.0, [], with_audiofile=no)
608    AC_SUBST(AUDIOFILE_CFLAGS)
609    AC_SUBST(AUDIOFILE_LIBS)
610    if test "$with_audiofile" = "no"; then
611    	AC_MSG_ERROR($AUDIOFILE_PKG_ERRORS)
612    fi
613
614    ARTSC_LIBS=`$ARTSC --libs`
615    ARTSC_CFLAGS=`$ARTSC --cflags`
616    AC_SUBST(ARTSC_LIBS)
617    AC_SUBST(ARTSC_CFLAGS)
618
619else
620     with_arts=no
621fi
622
623AC_ARG_WITH(oss, [  --without-oss		  Build without OSS sound plugin])
624if test "x$with_oss" != "xno"; then
625    with_oss=yes
626    have_soundcardh=no
627    AC_CHECK_HEADERS(sys/soundcard.h, have_soundcardh=yes, have_soundcardh=no)
628
629    PKG_CHECK_MODULES(AUDIOFILE,audiofile >= 0.2.0, [], with_audiofile=no)
630    AC_SUBST(AUDIOFILE_CFLAGS)
631    AC_SUBST(AUDIOFILE_LIBS)
632    if test "$with_audiofile" = "no"; then
633    	AC_MSG_ERROR($AUDIOFILE_PKG_ERRORS)
634    fi
635
636    if test "$have_soundcardh" = yes; then
637	with_oss=yes
638    else
639	with_oss=no
640    	AC_MSG_ERROR([*** unable to find sys/soundcard.h headers ***])
641    fi
642else
643    with_oss=no
644fi
645
646AC_ARG_WITH(external, [  --without-external	  Build without external player sound plugin])
647if test "x$with_external" != "xno"; then
648    with_external=yes
649else
650    with_external=no
651fi
652
653AC_ARG_WITH(history_external_viewer, [  --without-history-external-viewer	  Build without external history plugin])
654if test "x$with_history_external_viewer" != "xno"; then
655    with_history_external_viewer=yes
656else
657    with_history_external_viewer=no
658fi
659
660AC_ARG_WITH(update, [  --without-update		  Build without update plugin])
661if test "x$with_update" != "xno"; then
662	with_update=yes
663else
664	with_update=no
665fi
666
667
668AM_CONDITIONAL(BUILD_GGHIST, test "$with_gghist" = "yes")
669AM_CONDITIONAL(BUILD_GUI, test "$with_gui" = "yes")
670AM_CONDITIONAL(USE_GTKSPELL, test "$with_gtkspell" = "yes")
671AM_CONDITIONAL(BUILD_GG, test "$with_gadu" = "yes")
672AM_CONDITIONAL(BUILD_TLEN, test "$with_tlen" = "yes")
673AM_CONDITIONAL(BUILD_JABBER, test "$with_jabber" = "yes")
674AM_CONDITIONAL(BUILD_XOSD, test "$with_xosd" = "yes")
675AM_CONDITIONAL(BUILD_DOCKLET_SYSTEM_TRAY, test "$with_docklet_system_tray" = "yes")
676AM_CONDITIONAL(BUILD_DOCKLET_DOCKAPP, test "$with_docklet_dockapp" = "yes")
677AM_CONDITIONAL(BUILD_SOUND_ESD, test "$with_esd" = "yes")
678AM_CONDITIONAL(BUILD_SOUND_ARTS, test "$with_arts" = "yes")
679AM_CONDITIONAL(BUILD_SOUND_OSS, test "$with_oss" = "yes")
680AM_CONDITIONAL(BUILD_SOUND_EXTERNAL, test "$with_external" = "yes")
681AM_CONDITIONAL(BUILD_HISTORY_EXTERNAL_VIEWER_PLUGIN, test "$with_history_external_viewer" = "yes")
682AM_CONDITIONAL(BUILD_SMS, test "$with_sms" = "yes")
683AM_CONDITIONAL(BUILD_AAWAY, test "$with_aaway" = "yes")
684AM_CONDITIONAL(BUILD_IGNORE, test "$with_ignore" = "yes")
685#AM_CONDITIONAL(BUILD_REMOTE, test "$with_remote" = "yes")
686AM_CONDITIONAL(BUILD_DBUS, test "$with_dbus" = "yes")
687AM_CONDITIONAL(BUILD_UPDATE, test "$with_update" = "yes")
688AM_CONDITIONAL(BUILD_GNUTLS, test "$with_gnutls" = "yes")
689
690# Set PACKAGE_DATA_DIR in config.h.
691if test "x${datadir}" = 'x${prefix}/share'; then
692  if test "x${prefix}" = "xNONE"; then
693    AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}")
694  else
695    AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}")
696  fi
697else
698  AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datadir}/${PACKAGE}")
699fi
700
701# Set PACKAGE_LOCAL_DIR in config.h.
702if test "x${datadir}" = 'x${prefix}/share'; then
703  if test "x${prefix}" = "xNONE"; then
704    AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${ac_default_prefix}/share/locale")
705  else
706    AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${prefix}/share/locale")
707  fi
708else
709  AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${datadir}/locale")
710fi
711
712
713# Set PACKAGE_SOURCE_DIR in config.h.
714packagesrcdir=`cd $srcdir && pwd`
715AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}")
716
717CFLAGS_CLEAN="$CFLAGS"
718CFLAGS="$CFLAGS -I${packagesrcdir}/lib"
719
720AC_SUBST(CFLAGS)
721AC_SUBST(CFLAGS_CLEAN)
722AC_SUBST(LDFLAGS)
723
724
725AC_SUBST_FILE(gg2_menu)
726gg2_menu=$srcdir/lib/ggadu_menu.h
727AC_SUBST_FILE(gg2_types)
728gg2_types=$srcdir/lib/ggadu_types.h
729AC_SUBST_FILE(gg2_plugins)
730gg2_plugins=$srcdir/lib/plugins.h
731AC_SUBST_FILE(gg2_conf)
732gg2_conf=$srcdir/lib/ggadu_conf.h
733AC_SUBST_FILE(gg2_repo)
734gg2_repo=$srcdir/lib/ggadu_repo.h
735AC_SUBST_FILE(gg2_signals)
736gg2_signals=$srcdir/lib/signals.h
737AC_SUBST_FILE(gg2_dialog)
738gg2_dialog=$srcdir/lib/ggadu_dialog.h
739AC_SUBST_FILE(gg2_support)
740gg2_support=$srcdir/lib/ggadu_support.h
741AC_SUBST_FILE(gg2_perl_embed)
742gg2_perl_embed=$srcdir/lib/perl_embed.h
743
744
745AC_OUTPUT([
746intl/Makefile
747po/Makefile.in
748Makefile
749lib/Makefile
750lib/gg2_core.pc
751lib/gg2_core.h
752contrib/Makefile
753contrib/gghist/Makefile
754src/Makefile
755src/plugins/Makefile
756src/plugins/GUI/Makefile
757src/plugins/gadu_gadu/Makefile
758src/plugins/tlen/Makefile
759src/plugins/jabber/Makefile
760src/plugins/xosd/Makefile
761src/plugins/aaway/Makefile
762src/plugins/ignore/Makefile
763src/plugins/docklet/Makefile
764src/plugins/docklet/system-tray/Makefile
765src/plugins/docklet/dockapp/Makefile
766src/plugins/sound/Makefile
767src/plugins/sound/esd/Makefile
768src/plugins/sound/arts/Makefile
769src/plugins/sound/oss/Makefile
770src/plugins/sound/external/Makefile
771src/plugins/sms/Makefile
772src/plugins/dbus/Makefile
773src/plugins/dbus/org.freedesktop.im.GG.service
774src/plugins/update/Makefile
775src/plugins/history/Makefile
776src/plugins/history/external/Makefile
777pixmaps/Makefile
778pixmaps/emoticons/Makefile
779pixmaps/icons/Makefile
780pixmaps/icons/bubble/Makefile
781pixmaps/icons/classic/Makefile
782pixmaps/icons/ghosts/Makefile
783pixmaps/icons/modern/Makefile
784pixmaps/icons/rozgwiazda/Makefile
785sounds/Makefile
786themes/Makefile
787])
788#src/plugins/remote/Makefile
789
790# sed -e 's/#include \"ggadu_types.h\"//g' $srcdir/lib/gg2_core.h > $srcdir/lib/gg2_core.h-
791# mv -f $srcdir/lib/gg2_core.h- $srcdir/lib/gg2_core.h
792
793
794echo
795echo Build plugin GUI-GTK2.................. : $with_gui
796echo Build plugin GUI with gtkspell support. : $with_gtkspell
797echo Build plugin Gadu-Gadu................. : $with_gadu
798echo Build plugin Tlen.pl................... : $with_tlen
799echo Build plugin Jabber.................... : $with_jabber
800echo Build plugin XOSD...................... : $with_xosd
801echo Build plugin docklet-system-tray....... : $with_docklet_system_tray
802echo Build plugin docklet-dockapp........... : $with_docklet_dockapp
803echo Build plugin sound ESD................. : $with_esd
804echo Build plugin sound aRts................ : $with_arts
805echo Build plugin sound OSS................. : $with_oss
806echo Build plugin sound external............ : $with_external
807echo Build plugin sms....................... : $with_sms
808echo Build plugin Auto Away................. : $with_aaway
809echo Build plugin Ignore.................... : $with_ignore
810echo Build plugin update.................... : $with_update
811echo Build plugin external history viewer... : $with_history_external_viewer
812#echo Build plugin remote - deprecated....... : $with_remote
813echo Build plugin DBUS...................... : $with_dbus
814echo Build gghist - history viewer.......... : $with_gghist
815echo Build with experimental perl support... : $with_perl
816echo Build with gnutls...................... : $with_gnutls
817echo
818echo "*************************************************************"
819echo Remember that GNU Gadu 2 built without any plugin,
820echo especially without gui plugin is probably useless for you!
821echo Check \"./configure --help\" to see how to enable some plugins
822echo
823echo You may enable all plugins with:
824echo \"./configure --with-all-plugins\"
825echo "*************************************************************"
826echo Please check README file for requirements !!!
827echo "*************************************************************"
828echo
829echo configure complete, now type \"make\"
830echo
831