root/branches/vendor/third/gaim/configure.ac @ 22221

Revision 22221, 38.5 KB (checked in by ghudson, 4 years ago)

Import gaim 1.4.0.

Line 
1dnl Process this file with autoconf to produce a configure script.
2AC_INIT([gaim], [1.4.0], [gaim-devel@lists.sourceforge.net])
3AC_CANONICAL_SYSTEM
4AM_CONFIG_HEADER(config.h)
5AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
6
7AC_PREREQ([2.50])
8
9AC_PATH_PROG(sedpath, sed)
10
11dnl Storing configure arguments
12AC_DEFINE_UNQUOTED(CONFIG_ARGS, "$ac_configure_args", [configure arguments])
13
14dnl Checks for programs.
15AC_PROG_CC
16AC_DISABLE_STATIC
17AM_PROG_LIBTOOL
18LIBTOOL="$LIBTOOL --silent"
19AC_PROG_INSTALL
20
21# before gettexting, in case iconv matters
22case "$host_os" in
23darwin*)
24        AC_MSG_CHECKING([for fink])
25        if test -d /sw; then
26                AC_MSG_RESULT([found, adding /sw to search paths])
27                CFLAGS="$CFLAGS -I/sw/include"
28        else
29                AC_MSG_RESULT([not found])
30        fi
31        ;;
32*)
33        ;;
34esac
35
36ALL_LINGUAS="am az bg ca cs da de en_AU en_CA en_GB es et fi fr he hi hu it ja ka ko lt mk my_MM nb nl nn pa pl pt_BR pt ro ru sk sl sq sr sr@Latn sv tr uk vi zh_CN zh_TW"
37AM_GNU_GETTEXT_VERSION(0.10.40)
38AM_GNU_GETTEXT
39
40dnl we don't use autobreak on cygwin!!
41dnl AC_CYGWIN
42
43dnl Checks for header files.
44AC_HEADER_STDC
45AC_HEADER_SYS_WAIT
46AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h locale.h signal.h stdint.h)
47
48dnl Checks for typedefs, structures, and compiler characteristics.
49AC_C_CONST
50AC_STRUCT_TM
51
52dnl Checks for library functions.
53AC_TYPE_SIGNAL
54AC_FUNC_STRFTIME
55AC_CHECK_FUNCS(strdup strstr atexit)
56dnl Checks for getopt in standard library
57AC_CHECK_FUNCS(getopt_long,,
58[
59        AC_LIBOBJ(getopt)
60        AC_LIBOBJ(getopt1)
61])
62
63dnl Check for inet_aton
64AC_CHECK_FUNC(inet_aton, , [AC_CHECK_LIB(resolv, inet_aton, ,
65                                         [AC_ERROR(inet_aton not found)])])
66AC_CHECK_LIB(nsl, gethostent)
67AC_CHECK_FUNC(socket, ,
68              [AC_CHECK_LIB(socket, socket, , [AC_ERROR([socket not found])])])
69dnl If all goes well, by this point the previous two checks will have
70dnl pulled in -lsocket and -lnsl if we need them.
71AC_CHECK_FUNC(getaddrinfo, [AC_DEFINE([HAVE_GETADDRINFO], [1],
72                                      [Define to 1 if you have the getaddrinfo function.])],
73              [AC_CHECK_LIB(socket, getaddrinfo,
74                            [AC_DEFINE([HAVE_GETADDRINFO]) LIBS="-lsocket -lsnl $LIBS"], , , -lnsl)])
75
76dnl Check for socklen_t (in Unix98)
77AC_MSG_CHECKING(for socklen_t)
78AC_TRY_COMPILE([
79        #include <sys/types.h>
80        #include <sys/socket.h>
81        socklen_t x;
82], [],
83[
84        AC_MSG_RESULT(yes)
85], [
86        AC_TRY_COMPILE([
87                #include <sys/types.h>
88                #include <sys/socket.h>
89                int accept(int, struct sockaddr *, size_t *);
90        ], [], [
91                AC_MSG_RESULT(size_t)
92                AC_DEFINE(socklen_t, size_t, [socklen_t size])
93        ], [
94                AC_MSG_RESULT(int)
95                AC_DEFINE(socklen_t, int, [socklen_t size])
96        ])
97])
98
99dnl to prevent the g_stat()/g_unlink() crash,
100dnl (09:50:07) Robot101: LSchiere2: it's easy. +LC_SYS_LARGEFILE somewhere in configure.ac
101AC_SYS_LARGEFILE
102
103dnl Check for SILC client includes and libraries
104AC_ARG_WITH(silc-includes, [  --with-silc-includes=DIR
105                          Compile the SILC plugin against includes in DIR ], [ac_silc_includes="$withval"], [ac_silc_includes="no"])
106AC_ARG_WITH(silc-libs, [  --with-silc-libs=DIR    Compile the SILC plugin against the SILC libs in DIR], [ac_silc_libs="$withval"], [ac_silc_libs="no"])
107SILC_CFLAGS=""
108SILC_LIBS=""
109if test -n "$with_silc_includes" || test -n "$with_silc_libs"; then
110        silc_manual_check="yes"
111else
112        silc_manual_check="no"
113fi
114if test "x$silc_manual_check" = "xno"; then
115        PKG_CHECK_MODULES(SILC, silcclient, [
116                have_silc="yes"
117                silcincludes="yes"
118                silcclient="yes"
119        ], have_silc="no")
120        dnl If silcclient.pc wasn't found, check for just silc.pc
121        if test "x$have_silc" = "xno"; then
122                PKG_CHECK_MODULES(SILC, silc, [
123                        have_silc="yes"
124                        silcincludes="yes"
125                        silcclient="yes"
126                ], have_silc="no")
127        fi
128else
129        if test "$ac_silc_includes" != "no"; then
130                SILC_CFLAGS="-I$ac_silc_includes"
131        fi
132        CPPFLAGS_save="$CPPFLAGS"
133        CPPFLAGS="$CPPFLAGS $SILC_CFLAGS"
134        AC_CHECK_HEADER(silcincludes.h, [silcincludes=yes])
135        CPPFLAGS="$CPPFLAGS_save"
136
137        if test "$ac_silc_libs" != "no"; then
138                SILC_LIBS="-L$ac_silc_libs"
139        fi
140        SILC_LIBS="$SILC_LIBS -lsilc -lsilcclient -lpthread -ldl"
141        AC_CHECK_LIB(silcclient, silc_client_init, [silcclient=yes], , $SILC_LIBS)
142fi
143AC_SUBST(SILC_LIBS)
144AC_SUBST(SILC_CFLAGS)
145
146AC_ARG_ENABLE(distrib,,,enable_distrib=no)
147AM_CONDITIONAL(DISTRIB, test "x$enable_distrib" = "xyes")
148AC_ARG_ENABLE(prpls,   [  --disable-prpls         don't build dynamic protocol plugins],,enable_prpls=yes)
149DYNAMIC_PRPLS=all
150AC_ARG_WITH(static-prpls,    [  --with-static-prpls     link in certain protocols statically],[STATIC_PRPLS=`echo $withval | $sedpath 's/,/ /g'`],STATIC_PRPLS="")
151if test "x$STATIC_PRPLS" != "x" -a "x$DYNAMIC_PRPLS" = "xall"; then
152        DYNAMIC_PRPLS=""
153fi
154
155if test "x$STATIC_PRPLS" = "xall" ; then
156        STATIC_PRPLS="gg irc jabber msn napster novell oscar silc yahoo zephyr"
157fi
158if test "x$silcincludes" != "xyes" -o "x$silcclient" != "xyes"; then
159        STATIC_PRPLS=`echo $STATIC_PRPLS | $sedpath 's/silc//'`
160fi
161AC_SUBST(STATIC_PRPLS)
162STATIC_LINK_LIBS=
163extern_init=
164load_proto=
165for i in $STATIC_PRPLS ; do
166        STATIC_LINK_LIBS="$STATIC_LINK_LIBS protocols/$i/lib$i.a"
167        extern_init="$extern_init extern gboolean gaim_init_${i}_plugin();"
168        load_proto="$load_proto gaim_init_${i}_plugin();"
169        case $i in
170                gg)                     static_gg=yes ;;
171                irc)            static_irc=yes ;;
172                jabber)         static_jabber=yes ;;
173                msn)            static_msn=yes ;;
174                napster)        static_napster=yes ;;
175                novell)         static_novell=yes ;;
176                oscar)          static_oscar=yes ;;
177                rendezvous)     static_rendezvous=yes ;;
178                silc)           static_silc=yes ;;
179                toc)            static_toc=yes ;;
180                trepia)         static_trepia=yes ;;
181                yahoo)          static_yahoo=yes ;;
182                zephyr)         static_zephyr=yes ;;
183                *)                      echo "Invalid static protocol $i!!" ; exit ;;
184        esac
185done
186AM_CONDITIONAL(STATIC_GG, test "x$static_gg" = "xyes")
187AM_CONDITIONAL(STATIC_IRC, test "x$static_irc" = "xyes")
188AM_CONDITIONAL(STATIC_JABBER, test "x$static_jabber" = "xyes")
189AM_CONDITIONAL(STATIC_MSN, test "x$static_msn" = "xyes")
190AM_CONDITIONAL(STATIC_NAPSTER, test "x$static_napster" = "xyes")
191AM_CONDITIONAL(STATIC_NOVELL, test "x$static_novell" = "xyes")
192AM_CONDITIONAL(STATIC_OSCAR, test "x$static_oscar" = "xyes")
193AM_CONDITIONAL(STATIC_RENDEZVOUS, test "x$static_rendezvous" = "xyes")
194AM_CONDITIONAL(STATIC_SILC, test "x$static_silc" = "xyes" -a "x$silcincludes" = "xyes" -a "x$silcclient" = "xyes")
195AM_CONDITIONAL(STATIC_TOC, test "x$static_toc" = "xyes")
196AM_CONDITIONAL(STATIC_TREPIA, test "x$static_trepia" = "xyes")
197AM_CONDITIONAL(STATIC_YAHOO, test "x$static_yahoo" = "xyes")
198AM_CONDITIONAL(STATIC_ZEPHYR, test "x$static_zephyr" = "xyes")
199AC_SUBST(STATIC_LINK_LIBS)
200AC_DEFINE_UNQUOTED(STATIC_PROTO_INIT, $extern_init void static_proto_init() { $load_proto },
201        [Loads static protocol plugin module initialization functions.])
202
203AC_ARG_WITH(dynamic_prpls,   [  --with-dynamic-prpls    specify which protocols to build dynamically],[DYNAMIC_PRPLS=`echo $withval | $sedpath 's/,/ /g'`])
204if test "x$DYNAMIC_PRPLS" = "xall" ; then
205        DYNAMIC_PRPLS="gg irc jabber msn napster novell oscar silc yahoo zephyr"
206fi
207if test "x$silcincludes" != "xyes" -o "x$silcclient" != "xyes"; then
208        DYNAMIC_PRPLS=`echo $DYNAMIC_PRPLS | $sedpath 's/silc//'`
209fi
210AC_SUBST(DYNAMIC_PRPLS)
211for i in $DYNAMIC_PRPLS ; do
212        case $i in
213                gg)                     dynamic_gg=yes ;;
214                irc)            dynamic_irc=yes ;;
215                jabber)         dynamic_jabber=yes ;;
216                msn)            dynamic_msn=yes ;;
217                napster)        dynamic_napster=yes ;;
218                novell)         dynamic_novell=yes ;;
219                oscar)          dynamic_oscar=yes ;;
220                rendezvous)     dynamic_rendezvous=yes ;;
221                silc)           dynamic_silc=yes ;;
222                toc)            dynamic_toc=yes ;;
223                trepia)         dynamic_trepia=yes ;;
224                yahoo)          dynamic_yahoo=yes ;;
225                zephyr)         dynamic_zephyr=yes ;;
226                *)                      echo "Invalid dynamic protocol $i!!" ; exit ;;
227        esac
228done
229AM_CONDITIONAL(DYNAMIC_GG, test "x$dynamic_gg" = "xyes")
230AM_CONDITIONAL(DYNAMIC_IRC, test "x$dynamic_irc" = "xyes")
231AM_CONDITIONAL(DYNAMIC_JABBER, test "x$dynamic_jabber" = "xyes")
232AM_CONDITIONAL(DYNAMIC_MSN, test "x$dynamic_msn" = "xyes")
233AM_CONDITIONAL(DYNAMIC_NAPSTER, test "x$dynamic_napster" = "xyes")
234AM_CONDITIONAL(DYNAMIC_NOVELL, test "x$dynamic_novell" = "xyes")
235AM_CONDITIONAL(DYNAMIC_OSCAR, test "x$dynamic_oscar" = "xyes")
236AM_CONDITIONAL(DYNAMIC_RENDEZVOUS, test "x$dynamic_rendezvous" = "xyes")
237AM_CONDITIONAL(DYNAMIC_SILC, test "x$dynamic_silc" = "xyes" -a "x$silcincludes" = "xyes" -a "x$silcclient" = "xyes")
238AM_CONDITIONAL(DYNAMIC_TOC, test "x$dynamic_toc" = "xyes")
239AM_CONDITIONAL(DYNAMIC_TREPIA, test "x$dynamic_trepia" = "xyes")
240AM_CONDITIONAL(DYNAMIC_YAHOO, test "x$dynamic_yahoo" = "xyes")
241AM_CONDITIONAL(DYNAMIC_ZEPHYR, test "x$dynamic_zephyr" = "xyes")
242
243AC_ARG_ENABLE(audio,   [  --disable-audio         compile without libao/libaudiofile for sound playing],,enable_audio=yes)
244AC_ARG_ENABLE(nas,     [  --enable-nas            enable NAS (Network Audio System) support],,enable_nas=no)
245AC_ARG_ENABLE(plugins, [  --disable-plugins       compile without plugin support],,enable_plugins=yes)
246AC_ARG_ENABLE(perl,    [  --disable-perl          compile without perl scripting],,enable_perl=yes)
247AC_ARG_ENABLE(tcl,     [  --disable-tcl           compile without Tcl scripting],,enable_tcl=yes)
248AC_ARG_WITH(tclconfig, [  --with-tclconfig=DIR    directory containing tclConfig.sh])
249AC_ARG_ENABLE(tk,      [  --disable-tk            compile without Tcl support for Tk],,enable_tk=yes)
250AC_ARG_WITH(tkconfig,  [  --with-tkconfig=DIR     directory containing tkConfig.sh])
251AC_ARG_ENABLE(gtkspell, [  --disable-gtkspell      compile without GtkSpell automatic spell checking],,enable_gtkspell=yes)
252AC_ARG_ENABLE(debug,   [  --enable-debug          compile with debugging support],,enable_debug=no)
253AC_ARG_ENABLE(deprecated,    [  --disable-deprecated    compile without deprecated API usage],,enable_deprecated=yes)
254AC_ARG_ENABLE(screensaver,   [  --disable-screensaver   compile without X screensaver extension],,enable_xss=yes)
255AC_ARG_ENABLE(sm,      [  --disable-sm            compile without X session management support],,enable_sm=yes)
256AC_ARG_WITH(krb4,      [  --with-krb4=PREFIX      Compile Zephyr plugin with Kerberos 4 support],kerberos="$withval",kerberos="no")
257AC_ARG_WITH(zephyr,    [  --with-zephyr=PREFIX    Compile Zephyr plugin against external libzephyr],zephyr="$withval",zephyr="no")
258AM_CONDITIONAL(EXTERNAL_LIBZEPHYR, test "x$zephyr" != "xno")
259
260AC_CHECK_HEADER(sys/utsname.h)
261AC_CHECK_FUNC(uname)
262
263if test "$enable_debug" = yes ; then
264        AC_DEFINE(DEBUG, 1, [Define if debugging is enabled.])
265fi
266
267if test "x$enable_deprecated" = no; then
268        DEBUG_CFLAGS="$DEBUG_CFLAGS -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
269fi
270
271if test "x$GCC" = "xyes"; then
272        CFLAGS="$CFLAGS -Wall -g3"
273fi
274AC_SUBST(CFLAGS)
275
276AM_PATH_GLIB_2_0(2.0.0,,AC_MSG_ERROR([
277*** GLib 2.0 is required to build Gaim; please make sure you have the GLib
278*** development headers installed. The latest version of GLib is
279*** always available at http://www.gtk.org/.]))
280AM_PATH_GTK_2_0(2.0.0,,AC_MSG_ERROR([
281*** GTK+ 2.0 is required to build Gaim; please make sure you have the GTK+
282*** development headers installed. The latest version of GTK+ is
283*** always available at http://www.gtk.org/.]))
284
285AC_PATH_PROG(gaimpath, gaim)
286AC_SUBST(GTK_CFLAGS)
287AC_SUBST(GLIB_CFLAGS)
288
289AC_PATH_XTRA
290# We can't assume that $x_libraries will be set, because autoconf does not
291# set it in the case when the X libraries are in a standard place.
292# Ditto for $x_includes
293if test X"$x_libraries" = X"" ; then
294        x_libpath_add=
295else
296        x_libpath_add="-L$x_libraries"
297fi
298if test X"$x_includes" = X"" ; then
299        x_incpath_add=
300else
301        x_incpath_add="-I$x_includes"
302fi
303
304dnl #######################################################################
305dnl # Check for startup notification
306dnl #######################################################################
307AC_ARG_ENABLE(startup-notification, [  --disable-startup-notification    compile without startup notification support],,enable_startup_notification=yes)
308
309if test "x$enable_startup_notification" = "xyes"; then
310        PKG_CHECK_MODULES(STARTUP_NOTIFICATION, libstartup-notification-1.0 >= 0.5,
311        [
312                AC_DEFINE(HAVE_STARTUP_NOTIFICATION, 1, [Define if we're using libstartup-notification.])
313                echo "Building with libstartup-notification"
314                enable_startup_notification=yes
315        ],
316        [
317                echo "Building without libstartup-notification"
318                enable_startup_notification=no
319        ])
320
321        AC_SUBST(STARTUP_NOTIFICATION_CFLAGS)
322        AC_SUBST(STARTUP_NOTIFICATION_LIBS)
323fi
324
325
326dnl #######################################################################
327dnl # Check for stuff needed by the evolution integration plugin.
328dnl #######################################################################
329build_gevo=no
330AC_ARG_ENABLE(gevolution, [  --disable-gevolution    compile without the Gaim-Evolution plugin],,enable_gevolution=yes)
331
332if test "x$enable_gevolution" = "xyes"; then
333        evo_deps="libxml-2.0 libebook-1.2 libedata-book-1.2"
334        PKG_CHECK_MODULES(EVOLUTION_ADDRESSBOOK, $evo_deps, build_gevo=yes, build_gevo=no)
335        if test "x$build_gevo" = "xno"; then
336                evo_deps="libxml-2.0 libebook-1.0 libedata-book-1.0"
337                PKG_CHECK_MODULES(EVOLUTION_ADDRESSBOOK, $evo_deps, build_gevo=yes, build_gevo=no)
338        fi
339
340        AC_SUBST(EVOLUTION_ADDRESSBOOK_CFLAGS)
341        AC_SUBST(EVOLUTION_ADDRESSBOOK_LIBS)
342fi
343
344AM_CONDITIONAL(BUILD_GEVOLUTION, test "x$build_gevo" = "xyes")
345
346dnl #######################################################################
347dnl # Check for XScreenSaver
348dnl #######################################################################
349if test "x$enable_xss" = "xyes" ; then
350        old_LIBS="$LIBS"
351        LIBS="$LIBS $GTK_LIBS $x_libpath_add"
352        XSS_LIBS="no"
353        XSS_HEADERS="no"
354        AC_CHECK_LIB(Xext, XScreenSaverRegister,[XSS_LIBS="$X_LIBS $X_PRE_LIBS -lX11 -lXext $X_EXTRA_LIBS"],[],[-lX11 -lXext -lm])
355        AC_CHECK_LIB(Xss, XScreenSaverRegister,[XSS_LIBS="$X_LIBS $X_PRE_LIBS -lX11 -lXext $X_LIBS $X_EXTRA_LIBS -lXss"],[],[-lX11 -lXext -lm])
356        if test \! "$XSS_LIBS" = "no"; then
357                oldCPPFLAGS="$CPPFLAGS"
358                CPPFLAGS="$CPPFLAGS $x_incpath_add"
359                AC_TRY_COMPILE([
360#include <X11/Xlib.h>
361#include <X11/extensions/scrnsaver.h>
362                                ],[],[
363                                AC_DEFINE(USE_SCREENSAVER, 1, [Define if we're using XScreenSaver.])],[enable_xss=no]
364                                )
365                CPPFLAGS="$oldCPPFLAGS"
366        else
367               XSS_LIBS=""
368               enable_xss=no
369        fi
370        LIBS="$old_LIBS"
371else
372        XSS_LIBS=""
373        enable_xss=no
374fi
375AC_SUBST(XSS_LIBS)
376
377
378dnl #######################################################################
379dnl # Check for X session management libs
380dnl #######################################################################
381if test "x$enable_sm" = "xyes"; then
382        enable_sm=no
383        AC_CHECK_LIB(SM, SmcSaveYourselfDone, found_sm_lib=true, , [$x_libpath_add -lICE])
384        if test "$found_sm_lib" = "true"; then
385                oldCPPFLAGS="$CPPFLAGS"
386                CPPFLAGS="$CPPFLAGS $x_incpath_add"
387                AC_CHECK_HEADERS(X11/SM/SMlib.h, SM_LIBS="$x_libpath_add -lSM -lICE" enable_sm=yes)
388                CPPFLAGS="$oldCPPFLAGS"
389        fi
390else
391        SM_LIBS=""
392        enable_sm=no
393fi
394AC_SUBST(SM_LIBS)
395if test "$enable_sm" = "yes"; then
396        AC_DEFINE(USE_SM, 1, [Define if we're using X Session Management.])
397fi
398
399
400AC_DEFUN([GC_TM_GMTOFF],
401[AC_REQUIRE([AC_STRUCT_TM])dnl
402AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff,
403[AC_TRY_COMPILE([#include <sys/types.h>
404#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_gmtoff;],
405  ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)])
406if test "$ac_cv_struct_tm_gmtoff" = yes; then
407  AC_DEFINE(HAVE_TM_GMTOFF, 1, [tm_gmtoff is available.])
408fi
409])
410
411GC_TM_GMTOFF
412
413
414dnl #######################################################################
415dnl # Check for Perl support
416dnl #######################################################################
417if test "$enable_perl" = yes ; then
418        AC_PATH_PROG(perlpath, perl)
419        AC_MSG_CHECKING(for Perl compile flags)
420        PERL_CFLAGS=`$perlpath -MExtUtils::Embed -e ccopts 2>/dev/null`
421        if test "_$PERL_CFLAGS" = _ ; then
422                AC_MSG_RESULT([not found, building without perl.])
423                enable_perl = no
424        else
425                PERL_LIBS=`$perlpath -MExtUtils::Embed -e ldopts 2>/dev/null |$sedpath 's/-lgdbm //'`
426                PERL_LIBS=`echo $PERL_LIBS |$sedpath 's/-ldb //'`
427                PERL_LIBS=`echo $PERL_LIBS |$sedpath 's/-lndbm //'`
428                if test "$system" = "Linux"; then
429                        PERL_LIBS=`echo $PERL_LIBS |$sedpath 's/-lnsl //'`
430                        PERL_LIBS=`echo $PERL_LIBS |$sedpath 's/-lposix //'`
431                fi
432                PERL_LIBS=`echo $PERL_LIBS |$sedpath 's/-lc //'`
433                AC_MSG_RESULT(ok)
434
435                oldLIBS="$LIBS"
436                LIBS="$LIBS $PERL_LIBS"
437                AC_MSG_CHECKING(for libperl)
438                AC_CHECK_FUNCS(perl_run, [], enable_perl=no)
439                LIBS="$oldLIBS"
440
441                oldCPPFLAGS="$CPPFLAGS"
442                CPPFLAGS="$CPPFLAGS $PERL_CFLAGS"
443                AC_CHECK_HEADERS(EXTERN.h)
444                AC_CHECK_HEADERS(perl.h, [], enable_perl=no,
445                [#if HAVE_EXTERN_H
446                 # include <EXTERN.h>
447                 #endif])
448                CPPFLAGS="$oldCPPFLAGS"
449        fi
450fi
451
452if test "$enable_perl" = yes ; then
453        AC_PROG_PERL_MODULES(ExtUtils::MakeMaker, , have_makemaker=no)
454
455        if test "x$have_makemaker" = "xno"; then
456                enable_perl=no
457                PERL_CFLAGS=
458                PERL_LIBS=
459                AM_CONDITIONAL(USE_PERL, false)
460                AC_MSG_WARN(Compiling perl requires ExtUtils::MakeMaker)
461        else
462                AC_SUBST(PERL_CFLAGS)
463                AC_SUBST(PERL_LIBS)
464                AM_CONDITIONAL(USE_PERL, test "x$enable_perl" = "xyes")
465
466                dnl This is almost definitely wrong, but in case there's
467                dnl something I'm missing, I'll leave it in.
468                AC_CHECK_FUNCS(Perl_eval_pv)
469
470                AC_MSG_CHECKING(for old perl)
471                PERL_OLD=`$perlpath -e 'if($]<5.006){printf"yes\n";}else{printf"no\n";}'`
472
473                if test "x$PERL_OLD" = "xyes"; then
474                        AC_DEFINE(OLD_PERL, 1, [Define if old perl is installed.])
475                        AC_MSG_RESULT(yes)
476                else
477                        AC_MSG_RESULT(no)
478                fi
479
480                if test "x$prefix" != "xNONE"; then
481                        prefix=`eval echo $prefix`
482                        PERL_MM_PARAMS="INSTALLDIRS=vendor PREFIX=$prefix"
483                fi
484
485                AC_ARG_WITH(perl-lib,
486                [  --with-perl-lib=[site|vendor|DIR]  Specify where to install the
487                                                                   Perl libraries for gaim. Default is site.],
488                [
489                        if test "x$withval" = xsite; then
490                                PERL_MM_PARAMS=""
491                        elif test "x$withval" = xvendor; then
492                                if test -z "`$perlpath -v | grep '5\.0'`"; then
493                                        PERL_MM_PARAMS="INSTALLDIRS=vendor"
494                                else
495                                        PERL_MM_PARAMS="INSTALLDIRS=vendor PREFIX=`perl -e 'use Config; print $Config{prefix}'`"
496                                fi
497                        else
498                                PERL_MM_PARAMS="INSTALLDIRS=vendor PREFIX=$withval"
499                        fi
500                ])
501
502                AC_SUBST(PERL_MM_PARAMS)
503
504                AC_MSG_CHECKING(for DynaLoader.a)
505                DYNALOADER_A=`echo $PERL_LDFLAGS | $perlpath -pe 's/^(.* )*([[^ ]]*DynaLoader\.a).*/\2/'`
506
507                dnl Don't check libperl.a if dynaloader.a wasn't found.
508                if test -n "$DYNALOADER_A"; then
509                        AC_MSG_RESULT(yes)
510
511                        dnl Find either libperl.a or libperl.so
512                        AC_MSG_CHECKING(for libperl.a or libperl.so)
513                        LIBPERL_A=`echo "$PERL_LDFLAGS -L/usr/lib"|$perlpath -e 'foreach (split(/ /, <STDIN>)) { if (/^-L(.*)/) { my $dir=$1; if (\`ls $dir/libperl.so* 2>/dev/null\`) { print "-lperl"; last; }; if (-e "$dir/libperl.a") { print "$dir/libperl.a"; last } } };'`
514                        if test -z "$LIBPERL_A"; then
515                                AC_MSG_RESULT(no)
516                                DYNALOADER_A=
517                        else
518                                AC_MSG_RESULT(yes)
519
520                                if test "$LIBPERL_A" = "-lperl"; then
521                                        LIBPERL_A=
522                                fi
523                        fi
524
525                        PERL_LIBS=`echo $PERL_LIBS | $perlpath -pe 's/^(.* )*[[^ ]]*DynaLoader\.a/\1libperl_dynaloader.la/'`
526
527                        if test -n "$LIBPERL_A"; then
528                                PERL_LIBS=`echo $PERL_LDFLAGS | $sedpath -e 's/-lperl /libperl_orig.la /' -e 's/-lperl$/libperl_orig.la$/'`
529                        fi
530
531                        AC_SUBST(DYNALOADER_A)
532                        AC_SUBST(LIBPERL_A)
533                else
534                        AC_MSG_RESULT(no)
535                fi
536        fi
537else
538        PERL_CFLAGS=
539        PERL_LIBS=
540        AM_CONDITIONAL(USE_PERL, false)
541fi
542
543dnl #######################################################################
544dnl # SSL support
545dnl #
546dnl # Thanks go to Evolution for the checks.
547dnl #######################################################################
548
549dnl These two are inverses of each other <-- stolen from evolution!
550
551AC_ARG_ENABLE(gnutls,
552        [  --enable-gnutls=[yes,no]    Attempt to use GNUTLS for SSL support (preferred) [default=yes]],
553        [enable_gnutls="$enableval"],
554        [enable_gnutls="yes"])
555
556AC_ARG_ENABLE(nss,
557        [  --enable-nss=[yes,no,static]    Attempt to use Mozilla libnss for SSL support [default=yes]],
558        [enable_nss="$enableval"],
559        [enable_nss="yes"])
560
561msg_ssl="None"
562
563dnl #
564dnl # Check for GNUTLS if it's specified.
565dnl #
566if test "x$enable_gnutls" != "xno"; then
567        enable_gnutls="no"
568        prefix=`eval echo $prefix`
569
570        AC_ARG_WITH(gnutls-includes,
571                [  --with-gnutls-includes=PREFIX   Location of GNUTLS includes.],
572                [ with_gnutls_includes="$withval" ],
573                [ with_gnutls_includes="$prefix/include" ])
574
575        have_gnutls_includes="no"
576
577        if test "x$with_gnutls_includes" != "xno"; then
578                CPPFLAGS_save="$CPPFLAGS"
579
580                AC_MSG_CHECKING(for GNUTLS includes)
581                AC_MSG_RESULT("")
582
583                CPPFLAGS="$CPPFLAGS -I$with_gnutls_includes"
584                AC_CHECK_HEADERS(gnutls/gnutls.h, [ gnutls_includes="yes" ])
585                CPPFLAGS="$CPPFLAGS_save"
586
587                if test "x$gnutls_includes" != "xno" -a \
588                        "x$gnutls_includes" != "x"; then
589                        have_gnutls_includes="yes"
590
591                        GNUTLS_CFLAGS="-I$with_gnutls_includes"
592                else
593                        GNUTLS_CFLAGS=""
594                fi
595        else
596                AC_MSG_CHECKING(for GNUTLS includes)
597                AC_MSG_RESULT(no)
598        fi
599
600        AC_ARG_WITH(gnutls-libs,
601                [  --with-gnutls-libs=PREFIX       Location of GNUTLS libraries.],
602                [ with_gnutls_libs="$withval" ])
603
604        if test "x$with_gnutls_libs"     != "xno" -a \
605                "x$have_gnutls_includes" != "xno"; then
606
607                LDFLAGS_save="$LDFLAGS"
608
609                case $with_gnutls_libs in
610                        ""|-L*) ;;
611                        *) with_gnutls_libs="-L$with_gnutls_libs" ;;
612                esac
613
614                AC_CACHE_CHECK([for GNUTLS libraries], gnutls_libs,
615                [
616                        LDFLAGS="$LDFLAGS $with_gnutls_libs -lgnutls -lgcrypt"
617                        AC_TRY_LINK_FUNC(gnutls_init, gnutls_libs="yes", gnutls_libs="no")
618                        LDFLAGS="$LDFLAGS_save"
619                ])
620
621                if test "x$gnutls_libs" != "xno"; then
622                        AC_DEFINE(HAVE_GNUTLS, 1, [Define if you have GNUTLS])
623                        AC_DEFINE(HAVE_SSL)
624                        msg_gnutls="GNUTLS"
625                        GNUTLS_LIBS="$with_gnutls_libs -lgnutls -lgcrypt"
626
627                        enable_gnutls="yes"
628                else
629                        GNUTLS_CFLAGS=""
630                        GNUTLS_LIBS=""
631                fi
632        else
633                AC_MSG_CHECKING(for GNUTLS libraries)
634                AC_MSG_RESULT(no)
635        fi
636else
637        GNUTLS_CFLAGS=""
638        GNUTLS_LIBS=""
639fi
640
641AC_SUBST(GNUTLS_CFLAGS)
642AC_SUBST(GNUTLS_LIBS)
643
644AM_CONDITIONAL(USE_GNUTLS, test "x$enable_gnutls" = "xyes")
645
646
647dnl #
648dnl # Check for NSS if it's specified, or if GNUTLS checks failed.
649dnl #
650if test "x$enable_nss" != "xno"; then
651
652        AC_ARG_WITH(nspr-includes,
653                [  --with-nspr-includes=PREFIX     Specify location of Mozilla nspr4 includes.],
654                [with_nspr_includes="$withval"])
655
656        AC_ARG_WITH(nspr-libs,
657                [  --with-nspr-libs=PREFIX         Specify location of Mozilla nspr4 libs.],
658                [with_nspr_libs="$withval"])
659
660        AC_ARG_WITH(nss-includes,
661                [  --with-nss-includes=PREFIX      Specify location of Mozilla nss3 includes.],
662                [with_nss_includes="$withval"])
663
664        AC_ARG_WITH(nss-libs,
665                [  --with-nss-libs=PREFIX          Specify location of Mozilla nss3 libs.],
666                [with_nss_libs="$withval"])
667
668
669        if test -n "$with_nspr_includes" || test -n "$with_nspr_libs" || \
670           test -n "$with_nss_includes"  || test -n "$with_nss_libs"  ||
671           test "x$enable_nss" = "xstatic"; then
672
673                nss_manual_check="yes"
674        else
675                nss_manual_check="no"
676        fi
677
678        enable_nss="no"
679
680        if test "x$nss_manual_check" = "xno"; then
681                PKG_CHECK_MODULES(NSS, mozilla-nss, have_nss="yes", have_nss="no")
682
683                if test "x$have_nss" = "xyes"; then
684                        mozilla_nspr="mozilla-nspr"
685                        mozilla_nss="mozilla-nss"
686
687                        AC_DEFINE(HAVE_NSS, 1, [Define if you have Mozilla NSS])
688                        AC_DEFINE(HAVE_SSL, 1, [Define if you have SSL])
689
690                        msg_nss="Mozilla NSS"
691                        enable_nss="yes"
692                else
693                        nss_manual_check="yes"
694                fi
695        fi
696
697        if test "x$nss_manual_check" = "xyes"; then
698                mozilla_nss=""
699                have_nspr_includes="no"
700
701                if test "x$with_nspr_includes" != "xno"; then
702                        CPPFLAGS_save=$CPPFLAGS
703
704                        AC_MSG_CHECKING(for Mozilla nspr4 includes in $with_nspr_includes)
705                        AC_MSG_RESULT("")
706
707                        CPPFLAGS="$CPPFLAGS -I$with_nspr_includes"
708                        AC_CHECK_HEADERS(nspr.h prio.h, [ moz_nspr_includes="yes" ])
709                        CPPFLAGS=$CPPFLAGS_save
710
711                        if test "x$moz_nspr_includes" != "xno" -a \
712                                "x$moz_nspr_includes" != "x"; then
713
714                                have_nspr_includes="yes"
715                                NSPR_CFLAGS="-I$with_nspr_includes"
716                        fi
717                else
718                        AC_MSG_CHECKING(for Mozilla nspr4 includes)
719                        AC_MSG_RESULT(no)
720
721                        enable_nss="no"
722                fi
723
724                have_nspr_libs="no"
725
726                if test "x$with_nspr_libs"     != "xno" -a \
727                        "x$have_nspr_includes" != "xno"; then
728
729                        CFLAGS_save=$CFLAGS
730                        LDFLAGS_save=$LDFLAGS
731
732                        if test "$enable_nss" = "static"; then
733                                if test -z "$with_nspr_libs"; then
734                                        AC_MSG_ERROR(
735                                                [Static linkage requested, but path to nspr libraries not set.]
736                                                [Please specify the path to libnspr4.a]
737                                                [Example: --with-nspr-libs=/usr/lib])
738
739                                        enable_nss="no"
740                                else
741                                        nsprlibs="-ldl $with_nspr_libs/libplc4.a $with_nspr_libs/libplds4.a $with_nspr_libs/libnspr4.a $PTHREAD_LIB"
742                                fi
743                        else
744                                nsprlibs="-ldl -lplc4 -lplds4 -lnspr4 $PTHREAD_LIB"
745                        fi
746
747                        AC_CACHE_CHECK([for Mozilla nspr libraries], moz_nspr_libs,
748                        [
749                                LIBS_save=$LIBS
750                                CFLAGS="$CFLAGS $NSPR_CFLAGS"
751
752                                LIBS="$nsprlibs"
753
754                                if test "x$with_nspr_libs" != "x"; then
755                                        LDFLAGS="$LDFLAGS -L$with_nspr_libs"
756                                else
757                                        LDFLAGS="$LDFLAGS"
758                                fi
759
760                                AC_TRY_LINK_FUNC(PR_Init,
761                                        [moz_nspr_libs="yes"],
762                                        [moz_nspr_libs="no"])
763
764                                CFLAGS=$CFLAGS_save
765                                LDFLAGS=$LDFLAGS_save
766                                LIBS=$LIBS_save
767                        ])
768
769                        if test "x$moz_nspr_libs" != "xno"; then
770                                have_nspr_libs="yes"
771                                NSPR_LIBS="-L$with_nspr_libs $nsprlibs"
772                        else
773                                NSPR_CFLAGS=""
774                                enable_nss="no"
775                        fi
776                else
777                        AC_MSG_CHECKING(for Mozilla nspr4 libraries)
778                        AC_MSG_RESULT(no)
779                fi
780
781                have_nss_includes="no"
782
783                if test "x$with_nss_includes" != "xno" -a \
784                                "x$have_nspr_libs"    != "xno"; then
785
786                        CPPFLAGS_save=$CPPFLAGS
787
788                        AC_MSG_CHECKING(for Mozilla nss3 includes in $with_nss_includes)
789                        AC_MSG_RESULT("")
790
791                        if test "x$with_nspr_includes" != "x"; then
792                                CPPFLAGS="$CPPFLAGS -I$with_nspr_includes -I$with_nss_includes"
793                        else
794                                CPPFLAGS="$CPPFLAGS -I$with_nss_includes"
795                        fi
796
797                        AC_CHECK_HEADERS(nss.h ssl.h smime.h,
798                                [moz_nss_includes="yes"],
799                                [moz_nss_includes="no"])
800
801                        CPPFLAGS=$CPPFLAGS_save
802
803                        if test "x$moz_nss_includes" = "xyes"; then
804                                have_nss_includes="yes"
805                                NSS_CFLAGS="-I$with_nss_includes"
806                        else
807                                NSPR_CFLAGS=""
808                                NSPR_LIBS=""
809                                enable_nss="no"
810                        fi
811                else
812                        AC_MSG_CHECKING(for Mozilla nss3 includes)
813                        AC_MSG_RESULT(no)
814                        enable_nss="no"
815                fi
816
817                if test "x$with_nss_libs"     != "xno" -a \
818                                "x$have_nss_includes" != "xno"; then
819
820                        LDFLAGS_save=$LDFLAGS
821
822                        if test "$enable_nss" = "static"; then
823                                if test -z "$with_nss_libs"; then
824                                        AC_MSG_ERROR(
825                                                [Static linkage requested, but path to nss libraries not set.]
826                                                [Please specify the path to libnss3.a]
827                                                [Example: --with-nspr-libs=/usr/lib/mozilla])
828                                        enable_nss="no"
829                                else
830                                        nsslibs="-ldb1 $with_nss_libs/libnssckfw.a $with_nss_libs/libasn1.a $with_nss_libs/libcrmf.a $with_nss_libs/libswfci.a $with_nss_libs/libjar.a $with_nss_libs/libpkcs12.a $with_nss_libs/libpkcs7.a $with_nss_libs/libpki1.a $with_nss_libs/libsmime.a $with_nss_libs/libssl.a $with_nss_libs/libnss.a $with_nss_libs/libpk11wrap.a $with_nss_libs/libsoftokn.a $with_nss_libs/libfreebl.a $with_nss_libs/libnsspki.a $with_nss_libs/libnssdev.a $with_nss_libs/libcryptohi.a $with_nss_libs/libcerthi.a $with_nss_libs/libcertdb.a $with_nss_libs/libsecutil.a $with_nss_libs/libnssb.a"
831
832                                        case "$host" in
833                                                *solaris*)
834                                                        nsslibs="$nsslibs $with_nss_libs/libfreeb1.a"
835                                                        ;;
836                                        esac
837                                fi
838                        else
839                                nsslibs="-lssl3 -lsmime3 -lnss3 -lsoftokn3"
840                        fi
841
842                        AC_CACHE_CHECK([for Mozilla nss libraries], moz_nss_libs,
843                        [
844                                LIBS_save=$LIBS
845                                LDFLAGS="$LDFLAGS -L$with_nspr_libs $nsprlibs -L$with_nss_libs $nsslibs"
846                                LIBS="$nsslibs $nsprlibs"
847
848                                AC_TRY_LINK_FUNC(NSS_Init,
849                                        [moz_nss_libs="yes"],
850                                        [moz_nss_libs="no"])
851
852                                if test "x$moz_nss_libs" = "xno"; then
853                                        nsslibs="-lssl3 -lsmime3 -lnss3 -lsoftokn3"
854                                        LDFLAGS="$LDFLAGS -L$with_nspr_libs $nsprlibs -L$with_nss_libs $nsslibs"
855                                        AC_TRY_LINK_FUNC(NSS_Init,
856                                                [moz_nss_libs="yes"],
857                                                [moz_nss_libs="no"])
858                                fi
859
860                                LDFLAGS=$LDFLAGS_save
861                                LIBS=$LIBS_save
862                        ])
863
864                        if test "x$moz_nss_libs" != "xno"; then
865                                AC_DEFINE(HAVE_NSS)
866                                AC_DEFINE(HAVE_SSL)
867
868                                NSS_LIBS="-L$with_nss_libs $nsslibs"
869
870                                if test "$enable_nss" = "static"; then
871                                        msg_nss="Mozilla NSS (static)"
872                                else
873                                        msg_nss="Mozilla NSS"
874                                fi
875
876                                enable_nss="yes"
877                        else
878                                NSS_CFLAGS=""
879                                NSPR_CFLAGS=""
880                                NSPR_LIBS=""
881                                enable_nss="no"
882                        fi
883                else
884                        AC_MSG_CHECKING(for Mozilla nss libraries)
885                        AC_MSG_RESULT(no)
886                fi
887
888                NSS_CFLAGS="$NSPR_CFLAGS $NSS_CFLAGS"
889                NSS_LIBS="$NSPR_LIBS $NSS_LIBS"
890        fi
891
892        AC_SUBST(NSS_CFLAGS)
893        AC_SUBST(NSS_LIBS)
894fi
895
896AM_CONDITIONAL(USE_NSS, test "x$enable_nss" = "xyes")
897
898if test "x$msg_nss" != "x" -a "x$msg_gnutls" != "x"; then
899        msg_ssl="$msg_nss and $msg_gnutls"
900elif test "x$msg_nss" != "x"; then
901        msg_ssl=$msg_nss
902elif test "x$msg_gnutls" != "x"; then
903        msg_ssl=$msg_gnutls
904fi
905
906dnl Check for Tcl
907if test "$enable_tcl" = yes; then
908        AC_MSG_CHECKING([for tclConfig.sh])
909        TCLCONFIG=no
910        TCLCONFIGDIRS="/usr/lib \
911                       /usr/lib/tcl8.4 \
912                       /usr/lib/tcl8.3 \
913                       /usr/lib/tcl8.2 \
914                       /System/Library/Tcl/8.3 \
915                       /usr/local/lib"
916        for dir in $with_tclconfig $TCLCONFIGDIRS; do
917                if test -f $dir/tclConfig.sh; then
918                        TCLCONFIG=$dir/tclConfig.sh
919                        AC_MSG_RESULT([yes ($TCLCONFIG)])
920                fi
921        done
922        if test "$TCLCONFIG" = "no"; then
923                AC_MSG_RESULT([no])
924                enable_tcl=no
925        else
926                . $TCLCONFIG
927                AC_MSG_CHECKING([Tcl version compatability])
928                if test "$TCL_MAJOR_VERSION" -ne 8 -o "$TCL_MINOR_VERSION" -lt 3; then
929                        AC_MSG_RESULT([bad, $TCL_VERSION found but 8.3 or later required])
930                        enable_tcl=no
931                else
932                        AC_MSG_RESULT([ok, $TCL_VERSION])
933                        eval "TCL_LIB_SPEC=\"$TCL_LIB_SPEC\""
934                        AC_MSG_CHECKING([for Tcl linkability])
935                        oldCPPFLAGS=$CPPFLAGS
936                        CPPFLAGS="$CPPFLAGS $TCL_INCLUDE_SPEC -I$TCL_PREFIX/include"
937                        oldLIBS=$LIBS
938                        LIBS="$LIBS $TCL_LIB_SPEC"
939                        AC_TRY_LINK([#include <tcl.h>],
940                                    [Tcl_Interp *interp; Tcl_Init(interp)],
941                                    [AC_MSG_RESULT([yes]);enable_tcl=yes],
942                                    [AC_MSG_RESULT([no]);enable_tcl=no])
943                        CPPFLAGS="$oldCPPFLAGS"
944                        LIBS="$oldLIBS"
945                fi
946        fi
947fi
948
949if test "$enable_tcl" = yes; then
950        AM_CONDITIONAL(USE_TCL, true)
951        TCL_LIBS=$TCL_LIB_SPEC
952        AC_SUBST(TCL_LIBS)
953        AC_DEFINE(HAVE_TCL, [1], [Compile with support for the Tcl toolkit])
954        TCL_CFLAGS="$TCL_INCLUDE_SPEC -I$TCL_PREFIX/include"
955        if test "x$GCC" = "xyes"; then
956                TCL_CFLAGS="$TCL_CFLAGS -fno-strict-aliasing"
957        fi
958        AC_SUBST(TCL_CFLAGS)
959else
960        AM_CONDITIONAL(USE_TCL, false)
961fi
962
963dnl Check for Tk
964if test "$enable_tcl" = yes -a "$enable_tk" = yes; then
965        AC_MSG_CHECKING([for tkConfig.sh])
966        TKCONFIG=no
967        TKCONFIGDIRS="/usr/lib \
968                      /usr/lib/tk8.4 \
969                      /usr/lib/tk8.3 \
970                      /usr/lib/tk8.2 \
971                      /usr/local/lib"
972        for dir in $with_tkconfig $TKCONFIGDIRS; do
973                if test -f $dir/tkConfig.sh; then
974                        TKCONFIG=$dir/tkConfig.sh
975                        AC_MSG_RESULT([yes ($TKCONFIG)])
976                fi
977        done
978        if test "$TKCONFIG" = "no"; then
979                AC_MSG_RESULT([no])
980                enable_tk=no
981        else
982                . $TKCONFIG
983                eval "TK_LIB_SPEC=\"$TK_LIB_SPEC\""
984                AC_MSG_CHECKING([for Tk linkability])
985                oldCPPFLAGS=$CPPFLAGS
986                CPPFLAGS="$CPPFLAGS $TCL_CFLAGS"
987                oldLIBS=$LIBS
988                LIBS="$LIBS $TCL_LIB_SPEC $TK_LIB_SPEC"
989                AC_TRY_LINK([#include <tk.h>], [Tcl_Interp *interp; Tcl_Init(interp); Tk_Init(interp);],
990                            [AC_MSG_RESULT([yes]);enable_tk=yes],
991                            [AC_MSG_RESULT([no]);enable_tk=no])
992                CPPFLAGS="$oldCPPFLAGS"
993                LIBS="$oldLIBS"
994        fi
995else
996        enable_tk=no
997fi
998
999if test "$enable_tk" = yes; then
1000        AM_CONDITIONAL(USE_TK, true)
1001        AC_DEFINE(HAVE_TK, [1], [Compile with support for the Tk toolkit])
1002        TK_LIBS=$TK_LIB_SPEC
1003        AC_SUBST(TK_LIBS)
1004else
1005        AM_CONDITIONAL(USE_TK, false)
1006fi
1007
1008dnl Thanks, Evan.
1009if test "$enable_gtkspell" = yes ; then
1010        PKG_CHECK_MODULES(GTKSPELL, gtkspell-2.0 >= 2.0.2, , enable_gtkspell=no)
1011        if test "$enable_gtkspell" = "yes" ; then
1012                AC_SUBST(GTKSPELL_CFLAGS)
1013                AC_SUBST(GTKSPELL_LIBS)
1014                AC_DEFINE(USE_GTKSPELL,,[do we have gtkspell?])
1015        fi
1016fi
1017
1018if test "$enable_nas" = yes ; then
1019        AC_DEFINE(USE_NAS_AUDIO, 1, [Define if we have NAS sound support.])
1020        SOUND_LIBS="$SOUND_LIBS -laudio -lXt"
1021fi
1022
1023if test "$enable_audio" = yes ; then
1024        GAIM_PATH_AO(found_ao_lib=true)
1025
1026        AM_PATH_AUDIOFILE([0.2.0], found_af_lib=true)
1027
1028        if test "$found_ao_lib" = "true" -a "$found_af_lib" = "true"; then
1029                SOUND_LIBS="$SOUND_LIBS $AO_LIBS $AUDIOFILE_LIBS"
1030                AC_SUBST(SOUND_LIBS)
1031                AC_DEFINE(USE_AO, 1, [Define if we're using libao and libaudiofile for sound playing])
1032                enable_audio=yes
1033        else
1034                enable_audio=no
1035        fi
1036else
1037        enable_audio=no
1038fi
1039
1040if test "$ac_cv_cygwin" = yes ; then
1041        LDADD="$LDADD -static"
1042        AC_DEFINE(DEBUG, 1, [Define if debugging is enabled.])
1043fi
1044
1045AC_SUBST(DEBUG_CFLAGS)
1046AC_SUBST(LDADD)
1047AC_SUBST(LIBS)
1048
1049if test "x$enable_plugins" = "xyes" ; then
1050        AC_DEFINE(GAIM_PLUGINS, 1, [Define if plugins are enabled.])
1051        AM_CONDITIONAL(PLUGINS, test "x$enable_plugins" = "xyes")
1052else
1053        AM_CONDITIONAL(PLUGINS, false)
1054        enable_plugins=no
1055        enable_prpls=no
1056fi
1057
1058if test "x$enable_prpls" = "xyes" ; then
1059        AM_CONDITIONAL(PRPLS, test "x$enable_plugins" = "xyes")
1060else
1061        AM_CONDITIONAL(PRPLS, false)
1062        enable_prpls=no
1063fi
1064
1065dnl checks for icqlib
1066AC_CHECK_HEADERS(asm/byteorder.h byteswap.h endian.h machine/endian.h arpa/nameser_compat.h)
1067AC_CHECK_FUNCS(bswap_32 bswap_16)
1068AC_C_BIGENDIAN
1069
1070dnl checks for jabber
1071dnl AC_CHECK_SIZEOF(short)
1072AC_CHECK_FUNCS(snprintf connect)
1073
1074dnl checks for zephyr
1075AC_DEFINE(ZEPHYR_INT32, long, [Size of an int32.])
1076AC_SUBST(KRB4_CFLAGS)
1077AC_SUBST(KRB4_LDFLAGS)
1078AC_SUBST(KRB4_LIBS)
1079if test "$kerberos" != "no" ; then
1080        if test "$kerberos" != "yes" ; then
1081                KRB4_CFLAGS="-I${kerberos}/include"
1082                if test -d "$kerberos/include/kerberosIV" ; then
1083                        KRB4_CFLAGS="$KRB4_CFLAGS -I${kerberos}/include/kerberosIV"
1084                fi
1085                KRB4_LDFLAGS="-L${kerberos}/lib"
1086        elif test -d /usr/local/include/kerberosIV ; then
1087                KRB4_CFLAGS="-I/usr/local/include/kerberosIV"
1088        elif test -d /usr/include/kerberosIV ; then
1089                KRB4_CFLAGS="-I/usr/include/kerberosIV"
1090        fi
1091        AC_DEFINE(ZEPHYR_USES_KERBEROS, 1, [Define if kerberos should be used in Zephyr.])
1092
1093        orig_LDFLAGS="$LDFLAGS"
1094        LDFLAGS="$LDFLAGS $KRB4_LDFLAGS"
1095        AC_CHECK_LIB(krb4, krb_rd_req,
1096                        [KRB4_LIBS="-lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err"],
1097                        [AC_CHECK_LIB(krb, krb_rd_req,
1098                                [KRB4_LIBS="-lkrb -ldes"],
1099                                [AC_ERROR(Kerberos 4 libraries not found)],
1100                                -ldes)],
1101                        -ldes425 -lkrb5 -lk5crypto -lcom_err)
1102        orig_LIBS="$LIBS"
1103        LIBS="$LIBS $KRB4_LIBS"
1104        AC_CHECK_FUNCS(krb_set_key krb_rd_req krb_get_lrealm)
1105        AC_CHECK_FUNCS(krb_get_err_text krb_log)
1106        LIBS="$orig_LIBS"
1107        LDFLAGS="$orig_LDFLAGS"
1108fi
1109
1110dnl checks for an external libzephyr
1111AC_SUBST(ZEPHYR_CFLAGS)
1112AC_SUBST(ZEPHYR_LDFLAGS)
1113AC_SUBST(ZEPHYR_LIBS)
1114if test "$zephyr" != "no" ; then
1115        if test "$zephyr" != "yes" ; then
1116                ZEPHYR_CFLAGS="-I${zephyr}/include"
1117                ZEPHYR_LDFLAGS="-L${zephyr}/lib"
1118        elif test -d /usr/athena/include/zephyr ; then
1119                ZEPHYR_CFLAGS="-I/usr/athena/include"
1120        elif test -d /usr/include/zephyr ; then
1121                ZEPHYR_CFLAGS="-I/usr/include"
1122        elif test -d /usr/local/include/zephyr ; then
1123                ZEPHYR_CFLAGS="-I/usr/local/include"
1124        fi
1125        AC_DEFINE(LIBZEPHYR_EXT, 1 , [Define if external libzephyr should be used.])
1126        AM_CONDITIONAL(EXTERNAL_LIBZEPHYR, test "x$zephyr" != "xno")
1127        orig_LDFLAGS="$LDFLAGS"
1128        LDFLAGS="$LDFLAGS $ZEPHYR_LDFLAGS"
1129        AC_CHECK_LIB(zephyr, ZInitialize,
1130                          [ZEPHYR_LIBS="-lzephyr"],
1131                          [AC_ERROR(Zephyr libraries not found)],
1132                          -lzephyr)
1133        orig_LIBS="$LIBS"
1134        LIBS="$orig_LIBS"
1135        LDFLAGS="$orig_LDFLAGS"
1136fi
1137
1138AM_BINRELOC
1139
1140AC_MSG_CHECKING(for me pot o' gold)
1141AC_MSG_RESULT(no)
1142AC_CHECK_FUNCS(gethostid lrand48)
1143AC_CHECK_FUNCS(memcpy memmove random strchr strerror vprintf)
1144AC_CHECK_HEADERS(malloc.h paths.h sgtty.h stdarg.h sys/cdefs.h)
1145AC_CHECK_HEADERS(sys/file.h sys/filio.h sys/ioctl.h sys/msgbuf.h)
1146AC_CHECK_HEADERS(sys/select.h sys/uio.h sys/utsname.h sys/wait.h)
1147AC_CHECK_HEADERS(termios.h)
1148AC_VAR_TIMEZONE_EXTERNALS
1149
1150dnl #######################################################################
1151dnl # Doxygen Stuff
1152dnl #######################################################################
1153AC_ARG_ENABLE(doxygen, [  --enable-doxygen    enable documentation with doxygen],,enable_doxygen=yes)
1154AC_ARG_ENABLE(dot,     [  --enable-dot        enable graphs in doxygen via 'dot'],,enable_dot=yes)
1155
1156if test "x$enable_doxygen" = xyes; then
1157        AC_CHECK_PROG(DOXYGEN, doxygen, true, false)
1158        if test $DOXYGEN = false; then
1159                AC_MSG_WARN([*** doxygen not found, docs will not be available])
1160                enable_doxygen=no
1161        else
1162                AC_DEFINE_UNQUOTED(HAVE_DOXYGEN, 1, [whether or not we have doxygen])
1163
1164                if test "x$enable_dot" = xyes; then
1165                        AC_CHECK_PROG(DOT, dot, true, false)
1166
1167                        if test $DOT = false; then
1168                                enable_dot = no;
1169                                AC_MSG_WARN([*** dot not found, graphs will not be available])
1170                        else
1171                                AC_DEFINE_UNQUOTED(HAVE_DOT, 1, [whether or not we have dot])
1172                        fi
1173                else
1174                        AC_MSG_WARN([*** dot not found, graphs will not be available])
1175                fi
1176        fi
1177else
1178        enable_dot="no"
1179fi
1180
1181if test "x$enable_doxygen" = xyes; then
1182        AM_CONDITIONAL(HAVE_DOXYGEN, true)
1183else
1184        AM_CONDITIONAL(HAVE_DOXYGEN, false)
1185fi
1186
1187AC_SUBST(enable_doxygen)
1188AC_SUBST(enable_dot)
1189
1190AC_CONFIG_COMMANDS_PRE([
1191        if test -e VERSION; then
1192                cp -p VERSION VERSION.ac-save
1193        fi
1194])
1195
1196AC_CONFIG_COMMANDS_POST([
1197        cmp VERSION VERSION.ac-save || touch -r VERSION.ac-save VERSION
1198        rm -f VERSION.ac-save
1199])
1200
1201AC_OUTPUT([Makefile
1202                   Doxyfile
1203                   gaim.apspec
1204                   doc/Makefile
1205                   doc/gaim.1
1206                   doc/gaim-remote.1
1207                   intl/Makefile
1208                   pixmaps/Makefile
1209                   pixmaps/smileys/Makefile
1210                   pixmaps/smileys/default/Makefile
1211                   pixmaps/smileys/none/Makefile
1212                   pixmaps/status/Makefile
1213                   pixmaps/status/default/Makefile
1214                   plugins/Makefile
1215                   plugins/docklet/Makefile
1216                   plugins/gevolution/Makefile
1217                   plugins/gaim-remote/Makefile
1218                   plugins/gestures/Makefile
1219                   plugins/perl/Makefile
1220                   plugins/perl/common/Makefile.PL
1221                   plugins/ssl/Makefile
1222                   plugins/tcl/Makefile
1223                   plugins/ticker/Makefile
1224                   po/Makefile.in
1225                   sounds/Makefile
1226                   src/Makefile
1227                   src/protocols/Makefile
1228                   src/protocols/gg/Makefile
1229                   src/protocols/irc/Makefile
1230                   src/protocols/jabber/Makefile
1231                   src/protocols/msn/Makefile
1232                   src/protocols/napster/Makefile
1233                   src/protocols/novell/Makefile
1234                   src/protocols/oscar/Makefile
1235                   src/protocols/rendezvous/Makefile
1236                   src/protocols/silc/Makefile
1237                   src/protocols/toc/Makefile
1238                   src/protocols/trepia/Makefile
1239                   src/protocols/yahoo/Makefile
1240                   src/protocols/zephyr/Makefile
1241                   gaim.pc
1242                   gaim.spec
1243                  ])
1244
1245echo
1246echo $PACKAGE $VERSION
1247
1248echo
1249echo Build Protocol Plugins........ : $enable_prpls
1250echo Protocols to link statically.. : $STATIC_PRPLS
1251echo Protocols to build dynamically : $DYNAMIC_PRPLS
1252echo
1253echo UI Library.................... : GTK 2.x
1254echo SSL Library/Libraries......... : $msg_ssl
1255echo
1256echo Build with Plugin support..... : $enable_plugins
1257echo Build with Perl support....... : $enable_perl
1258echo Build with Tcl support........ : $enable_tcl
1259echo Build with Tk support......... : $enable_tk
1260echo Build with Audio support...... : $enable_audio
1261echo Build with NAS support........ : $enable_nas
1262echo Build with GtkSpell support... : $enable_gtkspell
1263echo
1264echo Use kerberos 4 with zephyr.... : $kerberos
1265echo Use external libzephyr........ : $zephyr
1266echo
1267echo Use XScreenSaver Extension.... : $enable_xss
1268echo Use X Session Management...... : $enable_sm
1269echo Use startup notification.......: $enable_startup_notification
1270echo
1271echo Print debugging messages...... : $enable_debug
1272echo
1273eval eval echo Gaim will be installed in $bindir.
1274if test "x$gaimpath" != "x" ; then
1275        echo Warning: You have an old copy of gaim at $gaimpath.
1276fi
1277echo
1278echo configure complete, now type \'make\'
1279echo
Note: See TracBrowser for help on using the browser.