gtk/plugins/crazychat/configure.ac

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

mercurial