1 dnl Process this file with autoconf to produce a configure script.
4 AC_CONFIG_AUX_DIR(config)
15 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
21 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
22 dnl AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
23 dnl AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
28 AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
29 if test "$GNOME_CONFIG" != no; then
30 gnomedatadir="`gnome-config --datadir`"
31 gnomeprefix="`gnome-config --prefix`"
32 if test "${prefix}" = "NONE"; then
33 gnomedatadir="${ac_default_prefix}/${gnomedatadir#${gnomeprefix}}"
35 gnomedatadir="${prefix}/${gnomedatadir#${gnomeprefix}}"
37 AC_SUBST(gnomedatadir)
39 AM_CONDITIONAL(SYLPHEED_GNOME, test -n "$gnomedatadir")
42 AC_DEFINE(CLAWS, 1, Compiling Claws branch of sylpheed)
44 dnl libtool versioning
45 LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
46 LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
47 LT_REVISION=$INTERFACE_AGE
48 LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
54 dnl Specify a header configuration file
55 AM_CONFIG_HEADER(config.h)
59 dnl Checks for programs.
73 SYLPHEED_ACLOCAL_INCLUDE(ac)
77 CFLAGS="$CFLAGS -traditional-cpp -fno-common"
84 ALL_LINGUAS="bg cs de el en_GB es fr hr hu it ja ko nl pl pt_BR ru sr sv zh_TW.Big5"
85 AM_GNU_GETTEXT([external])
86 dnl AC_CHECK_FUNC(gettext, AC_CHECK_LIB(intl, gettext))
87 localedir='${prefix}/${DATADIRNAME}/locale'
90 manualdir='${prefix}/${DATADIRNAME}/${PACKAGE}/manual'
92 faqdir='${prefix}/${DATADIRNAME}/${PACKAGE}/faq'
95 dnl Set PACKAGE_DATA_DIR in config.h.
96 if test "x${datadir}" = 'x${prefix}/share'; then
97 if test "x${prefix}" = "xNONE"; then
98 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}", PACKAGE_DATA_DIR)
100 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}", PACKAGE_DATA_DIR)
103 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datadir}/${PACKAGE}", PACKAGE_DATA_DIR)
106 AC_CHECK_LIB(xpg4, setlocale)
108 dnl for GThread support (currently disabled)
109 dnl AC_ARG_ENABLE(threads,
110 dnl [ --enable-threads Enable multithread support [default=no]],
111 dnl [use_threads=$enableval], [use_threads=no])
113 AC_MSG_CHECKING([whether to use threads])
114 if test x"$use_threads" = xyes ; then
116 if test ! -z `$GLIB_CONFIG --help 2>&1 |grep 'gthread'` ; then
117 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
118 LIBS="$LIBS `$GLIB_CONFIG --libs gthread`"
119 AC_DEFINE(USE_THREADS, 1, Whether to use multithread or not)
121 AC_MSG_ERROR([Sylpheed requires GThread from GLib to use threading.])
127 dnl Checks for header files.
131 AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
132 sys/param.h sys/utsname.h sys/select.h \
133 wchar.h wctype.h locale.h)
135 dnl alf - Check for apache installation f*ck up. apache may also install an
136 dnl fnmatch, which includes their own regex stuff if USE_HSREGEX is defined
137 AC_TRY_COMPILE([#include <stdlib.h>
138 #include <fnmatch.h>],
139 [int x = USE_HSREGEX;],
140 ac_cv_have_apache_fnmatch=yes, ac_cv_have_apache_fnmatch=no)
141 if test $ac_cv_have_apache_fnmatch = yes; then
142 AC_DEFINE(HAVE_APACHE_FNMATCH, 1, Define if you need to work around apache regex/fnmatch !KLUDGE!)
144 AC_MSG_CHECKING([whether to use Apache regex header kludge])
145 AC_MSG_RESULT($ac_cv_have_apache_fnmatch)
147 dnl Checks for typedefs, structures, and compiler characteristics.
154 dnl AC_CHECK_TYPE(wint_t, unsigned int) does not work because wint_t
155 dnl may be defined only in wchar.h (this happens with gcc-2.96).
156 dnl So we need to use this extended macro.
157 SYLPHEED_CHECK_TYPE(wint_t, unsigned int,
162 ], Define to `unsigned int' if <stddef.h> or <wchar.h> doesn't define.)
164 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF, Used to test for a u32 typedef)
165 AC_CHECK_SIZEOF(unsigned short, 2)
166 AC_CHECK_SIZEOF(unsigned int, 4)
167 AC_CHECK_SIZEOF(unsigned long, 4)
169 dnl Checks for library functions.
171 AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr strchr \
172 wcsstr wcswcs iswalnum iswspace towlower \
173 wcslen wcscpy wcsncpy \
174 uname flock lockf inet_aton inet_addr \
177 dnl *****************
178 dnl ** common code **
179 dnl *****************
183 AC_MSG_ERROR(Test for GLIB failed. See the file 'INSTALL' for help.),
186 dnl check for IPv6 option
188 [ --enable-ipv6 Enable IPv6 support [default=no]],
189 [ac_cv_enable_ipv6=$enableval], [ac_cv_enable_ipv6=no])
191 dnl automated checks for IPv6 support.
192 AC_MSG_CHECKING([whether to use IPv6])
193 if test x"$ac_cv_enable_ipv6" = xyes; then
195 AC_MSG_CHECKING([for IPv6 support])
196 AC_CACHE_VAL(ac_cv_ipv6,[
197 AC_TRY_COMPILE([#define INET6
198 #include <sys/types.h>
199 #include <netinet/in.h>],
200 [int x = IPPROTO_IPV6; struct in6_addr a;],
201 ac_cv_ipv6=yes, ac_cv_ipv6=no)
203 AC_MSG_RESULT($ac_cv_ipv6)
204 if test $ac_cv_ipv6 = yes; then
205 AC_DEFINE(INET6, 1, Define if you want IPv6 support.)
207 AC_MSG_WARN(*** IPv6 will not be supported ***)
214 dnl Check for OpenSSL
217 dnl Key for password encryption
218 AC_ARG_WITH(passcrypt-key, [ --with-passcrypt-key=KEY Key used to encode passwords (8 byte string)],
219 with_passcrypt_key="$withval", with_passcrypt_key="passkey0")
220 AC_SUBST(PASSCRYPT_KEY, $with_passcrypt_key)
222 dnl ************************
223 dnl ** GTK user interface **
224 dnl ************************
228 AC_MSG_ERROR(Test for GTK failed. See the file 'INSTALL' for help.))
230 dnl check if gdk / gtk was compiled with USE_XIM
231 AC_MSG_CHECKING([whether GTK was compiled with XIM support])
232 CFLAGS_SAVE="$CFLAGS"
233 LDFLAGS_SAVE="$LDFLAGS"
234 CFLAGS="$CFLAGS `$GTK_CONFIG --cflags`"
235 LDFLAGS="$LDFLAGS `$GTK_CONFIG --libs`"
236 AC_CACHE_VAL(ac_cv_use_xim, [
237 AC_TRY_LINK_FUNC([gdk_ic_attr_new],
238 ac_cv_use_xim=yes, ac_cv_use_xim=no)
240 AC_MSG_RESULT($ac_cv_use_xim)
241 if test $ac_cv_use_xim = yes; then
242 AC_DEFINE(USE_XIM, 1, Whether GTK was compiled with XIM support or not)
244 CFLAGS="$CFLAGS_SAVE"
245 LDFLAGS="$LDFLAGS_SAVE"
247 dnl GNU/Aspell is used for spell checking
248 AC_ARG_ENABLE(aspell,
249 [ --enable-aspell Enable GNU/aspell support [default=no]],
250 [ac_cv_enable_aspell=$enableval], [ac_cv_enable_aspell=no])
251 AC_MSG_CHECKING([whether to use GNU/aspell])
252 if test $ac_cv_enable_aspell = yes; then
254 AM_PATH_ASPELL(0.50, AC_DEFINE(USE_ASPELL, 1, Define if you use ASPELL to support spell checking),
255 [use_aspell=no ac_cv_enable_aspell=no])
260 dnl want crash dialog
261 AC_ARG_ENABLE(crash-dialog,
262 [ --enable-crash-dialog Enable crash dialog [default=no]],
263 [ac_cv_enable_crash_dialog=$enableval], [ac_cv_enable_crash_dialog=no])
264 if test $ac_cv_enable_crash_dialog = yes; then
265 dnl check if GDB is somewhere
266 AC_CHECK_PROG(ac_cv_enable_crash_dialog, gdb, yes, no)
267 AC_MSG_CHECKING([whether to use crash dialog])
268 if test $ac_cv_enable_crash_dialog = yes; then
269 AC_DEFINE(CRASH_DIALOG, 1, Pop up crash dialog)
271 AC_MSG_RESULT($ac_cv_enable_crash_dialog)
274 dnl Check for X-Face support
275 AC_ARG_ENABLE(compface,
276 [ --disable-compface Do not use compface (X-Face)],
277 [ac_cv_enable_compface=$enableval], [ac_cv_enable_compface=yes])
278 if test "$ac_cv_enable_compface" = yes; then
279 AC_CHECK_LIB(compface, uncompface,,[ac_cv_enable_compface=no])
282 dnl for LDAP support in addressbook
283 dnl no check for libraries; dynamically loaded
285 [ --enable-ldap Enable LDAP support [default=no]],
286 [ac_cv_enable_ldap=$enableval], [ac_cv_enable_ldap=no])
287 AC_MSG_CHECKING([whether to use LDAP])
288 if test "$ac_cv_enable_ldap" = yes; then
291 dnl check for available libraries, and pull them in
292 AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="$LDAP_LIBS -lresolv")
293 AC_CHECK_LIB(socket, bind, LDAP_LIBS="$LDAP_LIBS -lsocket")
294 AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl")
295 AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS="$LDAP_LIBS -llber",,
298 dnl we need libpthread for sylpheed ldap, until we find
299 dnl a better way to handle ldap requests asynchronously...
300 AC_CHECK_LIB(pthread, pthread_create, LDAP_LIBS="$LDAP_LIBS -lpthread")
302 AC_CHECK_HEADERS(ldap.h lber.h pthread.h,
303 [ ac_cv_enable_ldap=yes ],
304 [ ac_cv_enable_ldap=no ])
306 if test "$ac_cv_enable_ldap" = yes; then
307 AC_CHECK_LIB(ldap, ldap_open,
308 [ ac_cv_enable_ldap=yes ],
309 [ ac_cv_enable_ldap=no ],
313 AC_MSG_CHECKING([whether ldap library is available])
314 AC_MSG_RESULT($ac_cv_enable_ldap)
316 if test "$ac_cv_enable_ldap" = yes; then
317 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
318 LDAP_LIBS="$LDAP_LIBS -lldap `$GLIB_CONFIG --libs gthread`"
319 AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
326 dnl for JPilot support in addressbook
327 dnl no check for libraries; these are dynamically loaded
328 AC_ARG_ENABLE(jpilot,
329 [ --enable-jpilot Enable JPilot support [default=no]],
330 [ac_cv_enable_jpilot=$enableval], [ac_cv_enable_jpilot=no])
331 AC_MSG_CHECKING([whether to use JPilot])
332 if test "$ac_cv_enable_jpilot" = yes; then
334 AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h,
335 [ AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ],
336 [ ac_cv_enable_jpilot=no ])
337 if test "$ac_cv_enable_jpilot" = no; then
338 AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h,
339 [ ac_cv_enable_jpilot=yes
340 AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ])
342 AC_MSG_CHECKING([whether jpilot is available])
343 AC_MSG_RESULT($ac_cv_enable_jpilot)
345 if test "$ac_cv_enable_jpilot" = yes; then
346 LIBS="$LIBS -lpisock"
352 dnl GPGME is used to support OpenPGP
354 [ --enable-gpgme Enable GnuPG support using GPGME [default=no]],
355 [ac_cv_enable_gpgme=$enableval], [ac_cv_enable_gpgme=no])
356 AC_MSG_CHECKING([whether to use GPGME])
357 if test $ac_cv_enable_gpgme = yes; then
359 AM_PATH_GPGME(0.3.10, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.),
361 ac_cv_enable_gpgme=no])
366 dnl *************************
367 dnl ** section for plugins **
368 dnl *************************
372 AC_ARG_ENABLE(trayicon-plugin,
373 [ --enable-trayicon-plugin System Tray Icon [default=no]],
374 [ac_cv_enable_trayicon_plugin=$enableval], [ac_cv_enable_trayicon_plugin=no])
375 AM_CONDITIONAL(BUILD_TRAYICON_PLUGIN, test x"$ac_cv_enable_trayicon_plugin" = xyes)
376 if test x"$ac_cv_enable_trayicon_plugin" = xyes; then
377 PLUGINS="trayicon $PLUGINS"
380 AC_ARG_ENABLE(spamassassin-plugin,
381 [ --enable-spamassassin-plugin Build SpamAssassin plugin [default=no]],
382 [ac_cv_enable_spamassassin_plugin=$enableval], [ac_cv_enable_spamassassin_plugin=no])
383 AM_CONDITIONAL(BUILD_SPAMASSASSIN_PLUGIN, test x"$ac_cv_enable_spamassassin_plugin" = xyes)
384 if test x"$ac_cv_enable_spamassassin_plugin" = xyes; then
386 PLUGINS="spamassassin $PLUGINS"
389 AC_ARG_ENABLE(mathml-viewer-plugin,
390 [ --enable-mathml-viewer-plugin Build MathML-Viewer plugin [default=no]],
391 [ac_cv_enable_mathml_viewer_plugin=$enableval], [ac_cv_enable_mathml_viewer_plugin=no])
392 AM_CONDITIONAL(BUILD_MATHML_VIEWER_PLUGIN, test x"$ac_cv_enable_mathml_viewer_plugin" = xyes)
393 if test x"$ac_cv_enable_mathml_viewer_plugin" = xyes; then
394 GTK_MATH_VIEW_CFLAGS=$( gtkmathview-config --cflags )
395 GTK_MATH_VIEW_LIBS=$( gtkmathview-config --libs )
396 AC_SUBST(GTK_MATH_VIEW_CFLAGS)
397 AC_SUBST(GTK_MATH_VIEW_LIBS)
399 PLUGINS="mathml-viewer $PLUGINS"
402 AC_ARG_ENABLE(image-viewer-plugin,
403 [ --disable-image-viewer-plugin Do not build image viewer plugin],
404 [ac_cv_enable_image_viewer_plugin=$enableval], [ac_cv_enable_image_viewer_plugin=yes])
405 if test x"$ac_cv_enable_image_viewer_plugin" = xyes; then
406 AC_ARG_ENABLE(gdk-pixbuf,
407 [ --disable-gdk-pixbuf Do not use gdk-pixbuf],
408 [ac_cv_enable_gdk_pixbuf=$enableval], [ac_cv_enable_gdk_pixbuf=yes])
410 [ --disable-imlib Do not use imlib],
411 [ac_cv_enable_imlib=$enableval], [ac_cv_enable_imlib=yes])
413 if test "$ac_cv_enable_gdk_pixbuf" = yes; then
414 AM_PATH_GDK_PIXBUF(0.8.0,
415 [AC_DEFINE(HAVE_GDK_PIXBUF, 1, Define if you use gdk-pixbuf to support image viewer)
416 ac_cv_enable_imlib=no], [ac_cv_enable_gdk_pixbuf=no])
418 if test "$ac_cv_enable_imlib" = yes; then
419 AM_PATH_GDK_IMLIB(1.9,
420 AC_DEFINE(HAVE_GDK_IMLIB, 1, Define if you use gdk_imlib to support image viewer),
421 [ac_cv_enable_imlib=no])
423 if test "$ac_cv_enable_gdk_pixbuf" = no -a "$ac_cv_enable_imlib" = no; then
424 $ac_cv_enable_image_viewer_plugin = no
427 AM_CONDITIONAL(BUILD_IMAGE_VIEWER_PLUGIN, test x"$ac_cv_enable_image_viewer_plugin" = xyes)
428 if test x"$ac_cv_enable_image_viewer_plugin" = xyes; then
429 if test "$ac_cv_enable_gdk_pixbuf" = yes; then
430 PLUGINS="image-viewer(gdk-pixbuf) $PLUGINS"
431 elif test "$ac_cv_enable_imlib" = yes; then
432 PLUGINS="image-viewer(gdk_imlib) $PLUGINS"
436 AC_ARG_ENABLE(dillo-viewer-plugin,
437 [ --enable-dillo-viewer-plugin Build Dillo plugin for html mail rendering [default=no]],
438 [ac_cv_enable_dillo_viewer_plugin=$enableval], [ac_cv_enable_dillo_viewer_plugin=no])
439 AM_CONDITIONAL(BUILD_DILLO_VIEWER_PLUGIN, test x"$ac_cv_enable_dillo_viewer_plugin" = xyes)
440 if test x"$ac_cv_enable_dillo_viewer_plugin" = xyes; then
441 PLUGINS="dillo-viewer $PLUGINS"
444 AC_ARG_ENABLE(demo-plugin,
445 [ --enable-demo-plugin Build demo plugin [default=no]],
446 [ac_cv_enable_demo_plugin=$enableval], [ac_cv_enable_demo_plugin=no])
447 AM_CONDITIONAL(BUILD_DEMO_PLUGIN, test x"$ac_cv_enable_demo_plugin" = xyes)
448 if test x"$ac_cv_enable_demo_plugin" = xyes; then
449 PLUGINS="demo $PLUGINS"
452 AC_ARG_ENABLE(clamav-plugin,
453 [ --enable-clamav-plugin Build Clam AntiVirus plugin [default=no]],
454 [ac_cv_enable_clamav_plugin=$enableval], [ac_cv_enable_clamav_plugin=no])
455 AM_CONDITIONAL(BUILD_CLAMAV_PLUGIN, test x"$ac_cv_enable_clamav_plugin" = xyes)
456 if test x"$ac_cv_enable_clamav_plugin" = xyes; then
457 AC_CHECK_LIB(clamav, cl_scanfile, clamav_lib=-lclamav)
458 if test -z "${clamav_lib}"
460 AC_MSG_ERROR(clamav library not found)
462 CLAMAV_LIBS="${clamav_lib}"
463 AC_SUBST(CLAMAV_LIBS)
465 PLUGINS="clamav $PLUGINS"
468 dnl ****************************
469 dnl ** Final configure output **
470 dnl ****************************
481 src/common/passcrypt.h
484 src/plugins/demo/Makefile
485 src/plugins/spamassassin/Makefile
486 src/plugins/mathml_viewer/Makefile
487 src/plugins/dillo_viewer/Makefile
488 src/plugins/image_viewer/Makefile
489 src/plugins/trayicon/Makefile
490 src/plugins/trayicon/libeggtrayicon/Makefile
491 src/plugins/clamav/Makefile
509 dnl Output the configuration summary
511 echo "$PACKAGE $VERSION"
513 echo "GnuPG : $ac_cv_enable_gpgme"
514 echo "JPilot : $ac_cv_enable_jpilot"
515 echo "LDAP : $ac_cv_enable_ldap"
516 echo "OpenSSL : $ac_cv_enable_openssl"
517 echo "iconv : $am_cv_func_iconv"
518 echo "compface : $ac_cv_enable_compface"
519 echo "IPv6 : $ac_cv_enable_ipv6"
520 echo "GNU/aspell : $ac_cv_enable_aspell"
521 echo "Crash dialog : $ac_cv_enable_crash_dialog"
522 echo "Plugins : $PLUGINS"
524 echo "The binary will be installed in $prefix/bin"
526 echo "Configure finished, type 'make' to build."