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"
82 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"
84 dnl AC_CHECK_FUNC(gettext, AC_CHECK_LIB(intl, gettext))
85 localedir='${prefix}/${DATADIRNAME}/locale'
88 manualdir='${prefix}/${DATADIRNAME}/${PACKAGE}/manual'
90 faqdir='${prefix}/${DATADIRNAME}/${PACKAGE}/faq'
93 dnl Set PACKAGE_DATA_DIR in config.h.
94 if test "x${datadir}" = 'x${prefix}/share'; then
95 if test "x${prefix}" = "xNONE"; then
96 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}", PACKAGE_DATA_DIR)
98 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}", PACKAGE_DATA_DIR)
101 AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datadir}/${PACKAGE}", PACKAGE_DATA_DIR)
104 AC_CHECK_LIB(xpg4, setlocale)
106 dnl for GThread support (currently disabled)
107 dnl AC_ARG_ENABLE(threads,
108 dnl [ --enable-threads Enable multithread support [default=no]],
109 dnl [use_threads=$enableval], [use_threads=no])
111 AC_MSG_CHECKING([whether to use threads])
112 if test x"$use_threads" = xyes ; then
114 if test ! -z `$GLIB_CONFIG --help 2>&1 |grep 'gthread'` ; then
115 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
116 LIBS="$LIBS `$GLIB_CONFIG --libs gthread`"
117 AC_DEFINE(USE_THREADS, 1, Whether to use multithread or not)
119 AC_MSG_ERROR([Sylpheed requires GThread from GLib to use threading.])
125 dnl Checks for header files.
129 AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
130 sys/param.h sys/utsname.h sys/select.h \
133 dnl alf - Check for apache installation f*ck up. apache may also install an
134 dnl fnmatch, which includes their own regex stuff if USE_HSREGEX is defined
135 AC_TRY_COMPILE([#include <stdlib.h>
136 #include <fnmatch.h>],
137 [int x = USE_HSREGEX;],
138 ac_cv_have_apache_fnmatch=yes, ac_cv_have_apache_fnmatch=no)
139 if test $ac_cv_have_apache_fnmatch = yes; then
140 AC_DEFINE(HAVE_APACHE_FNMATCH, 1, Define if you need to work around apache regex/fnmatch !KLUDGE!)
142 AC_MSG_CHECKING([whether to use Apache regex header kludge])
143 AC_MSG_RESULT($ac_cv_have_apache_fnmatch)
145 dnl Checks for typedefs, structures, and compiler characteristics.
152 dnl AC_CHECK_TYPE(wint_t, unsigned int) does not work because wint_t
153 dnl may be defined only in wchar.h (this happens with gcc-2.96).
154 dnl So we need to use this extended macro.
155 SYLPHEED_CHECK_TYPE(wint_t, unsigned int,
160 ], Define to `unsigned int' if <stddef.h> or <wchar.h> doesn't define.)
162 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF, Used to test for a u32 typedef)
163 AC_CHECK_SIZEOF(unsigned short, 2)
164 AC_CHECK_SIZEOF(unsigned int, 4)
165 AC_CHECK_SIZEOF(unsigned long, 4)
167 dnl Checks for library functions.
169 AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr strchr \
170 wcsstr wcswcs iswalnum iswspace towlower \
171 wcslen wcscpy wcsncpy \
172 uname flock lockf inet_aton inet_addr \
175 dnl *****************
176 dnl ** common code **
177 dnl *****************
181 AC_MSG_ERROR(Test for GLIB failed. See the file 'INSTALL' for help.),
184 dnl check for IPv6 option
186 [ --enable-ipv6 Enable IPv6 support [default=no]],
187 [ac_cv_enable_ipv6=$enableval], [ac_cv_enable_ipv6=no])
189 dnl automated checks for IPv6 support.
190 AC_MSG_CHECKING([whether to use IPv6])
191 if test x"$ac_cv_enable_ipv6" = xyes; then
193 AC_MSG_CHECKING([for IPv6 support])
194 AC_CACHE_VAL(ac_cv_ipv6,[
195 AC_TRY_COMPILE([#define INET6
196 #include <sys/types.h>
197 #include <netinet/in.h>],
198 [int x = IPPROTO_IPV6; struct in6_addr a;],
199 ac_cv_ipv6=yes, ac_cv_ipv6=no)
201 AC_MSG_RESULT($ac_cv_ipv6)
202 if test $ac_cv_ipv6 = yes; then
203 AC_DEFINE(INET6, 1, Define if you want IPv6 support.)
205 AC_MSG_WARN(*** IPv6 will not be supported ***)
212 dnl Check for OpenSSL
215 dnl Key for password encryption
216 AC_ARG_WITH(passcrypt-key, [ --with-passcrypt-key=KEY Key used to encode passwords (8 byte string)],
217 with_passcrypt_key="$withval", with_passcrypt_key="passkey0")
218 AC_SUBST(PASSCRYPT_KEY, $with_passcrypt_key)
220 dnl ************************
221 dnl ** GTK user interface **
222 dnl ************************
226 AC_MSG_ERROR(Test for GTK failed. See the file 'INSTALL' for help.))
228 dnl check if gdk / gtk was compiled with USE_XIM
229 AC_MSG_CHECKING([whether GTK was compiled with XIM support])
230 CFLAGS_SAVE="$CFLAGS"
231 LDFLAGS_SAVE="$LDFLAGS"
232 CFLAGS="$CFLAGS `$GTK_CONFIG --cflags`"
233 LDFLAGS="$LDFLAGS `$GTK_CONFIG --libs`"
234 AC_CACHE_VAL(ac_cv_use_xim, [
235 AC_TRY_LINK_FUNC([gdk_ic_attr_new],
236 ac_cv_use_xim=yes, ac_cv_use_xim=no)
238 AC_MSG_RESULT($ac_cv_use_xim)
239 if test $ac_cv_use_xim = yes; then
240 AC_DEFINE(USE_XIM, 1, Whether GTK was compiled with XIM support or not)
242 CFLAGS="$CFLAGS_SAVE"
243 LDFLAGS="$LDFLAGS_SAVE"
245 dnl GNU/Aspell is used for spell checking
246 AC_ARG_ENABLE(aspell,
247 [ --enable-aspell Enable GNU/aspell support [default=no]],
248 [ac_cv_enable_aspell=$enableval], [ac_cv_enable_aspell=no])
249 AC_MSG_CHECKING([whether to use GNU/aspell])
250 if test $ac_cv_enable_aspell = yes; then
252 AM_PATH_ASPELL(0.50, AC_DEFINE(USE_ASPELL, 1, Define if you use ASPELL to support spell checking),
253 [use_aspell=no ac_cv_enable_aspell=no])
258 dnl want crash dialog
259 AC_ARG_ENABLE(crash-dialog,
260 [ --enable-crash-dialog Enable crash dialog [default=no]],
261 [ac_cv_enable_crash_dialog=$enableval], [ac_cv_enable_crash_dialog=no])
262 if test $ac_cv_enable_crash_dialog = yes; then
263 dnl check if GDB is somewhere
264 AC_CHECK_PROG(ac_cv_enable_crash_dialog, gdb, yes, no)
265 AC_MSG_CHECKING([whether to use crash dialog])
266 if test $ac_cv_enable_crash_dialog = yes; then
267 AC_DEFINE(CRASH_DIALOG, 1, Pop up crash dialog)
269 AC_MSG_RESULT($ac_cv_enable_crash_dialog)
272 dnl Check for X-Face support
273 AC_ARG_ENABLE(compface,
274 [ --disable-compface Do not use compface (X-Face)],
275 [ac_cv_enable_compface=$enableval], [ac_cv_enable_compface=yes])
276 if test "$ac_cv_enable_compface" = yes; then
277 AC_CHECK_LIB(compface, uncompface,,[ac_cv_enable_compface=no])
280 dnl for LDAP support in addressbook
281 dnl no check for libraries; dynamically loaded
283 [ --enable-ldap Enable LDAP support [default=no]],
284 [ac_cv_enable_ldap=$enableval], [ac_cv_enable_ldap=no])
285 AC_MSG_CHECKING([whether to use LDAP])
286 if test "$ac_cv_enable_ldap" = yes; then
289 dnl check for available libraries, and pull them in
290 AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="$LDAP_LIBS -lresolv")
291 AC_CHECK_LIB(socket, bind, LDAP_LIBS="$LDAP_LIBS -lsocket")
292 AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl")
293 AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS="$LDAP_LIBS -llber",,
296 dnl we need libpthread for sylpheed ldap, until we find
297 dnl a better way to handle ldap requests asynchronously...
298 AC_CHECK_LIB(pthread, pthread_create, LDAP_LIBS="$LDAP_LIBS -lpthread")
300 AC_CHECK_HEADERS(ldap.h lber.h pthread.h,
301 [ ac_cv_enable_ldap=yes ],
302 [ ac_cv_enable_ldap=no ])
304 if test "$ac_cv_enable_ldap" = yes; then
305 AC_CHECK_LIB(ldap, ldap_open,
306 [ ac_cv_enable_ldap=yes ],
307 [ ac_cv_enable_ldap=no ],
311 AC_MSG_CHECKING([whether ldap library is available])
312 AC_MSG_RESULT($ac_cv_enable_ldap)
314 if test "$ac_cv_enable_ldap" = yes; then
315 CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
316 LDAP_LIBS="$LDAP_LIBS -lldap `$GLIB_CONFIG --libs gthread`"
317 AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
324 dnl for JPilot support in addressbook
325 dnl no check for libraries; these are dynamically loaded
326 AC_ARG_ENABLE(jpilot,
327 [ --enable-jpilot Enable JPilot support [default=no]],
328 [ac_cv_enable_jpilot=$enableval], [ac_cv_enable_jpilot=no])
329 AC_MSG_CHECKING([whether to use JPilot])
330 if test "$ac_cv_enable_jpilot" = yes; then
332 AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h,
333 [ AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ],
334 [ ac_cv_enable_jpilot=no ])
335 if test "$ac_cv_enable_jpilot" = no; then
336 AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h,
337 [ ac_cv_enable_jpilot=yes
338 AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ])
340 AC_MSG_CHECKING([whether jpilot is available])
341 AC_MSG_RESULT($ac_cv_enable_jpilot)
343 if test "$ac_cv_enable_jpilot" = yes; then
344 LIBS="$LIBS -lpisock"
350 dnl GPGME is used to support OpenPGP
352 [ --enable-gpgme Enable GnuPG support using GPGME [default=no]],
353 [ac_cv_enable_gpgme=$enableval], [ac_cv_enable_gpgme=no])
354 AC_MSG_CHECKING([whether to use GPGME])
355 if test $ac_cv_enable_gpgme = yes; then
357 AM_PATH_GPGME(0.3.10, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.),
359 ac_cv_enable_gpgme=no])
364 dnl *************************
365 dnl ** section for plugins **
366 dnl *************************
370 AC_ARG_ENABLE(trayicon-plugin,
371 [ --enable-trayicon-plugin System Tray Icon [default=no]],
372 [ac_cv_enable_trayicon_plugin=$enableval], [ac_cv_enable_trayicon_plugin=no])
373 AM_CONDITIONAL(BUILD_TRAYICON_PLUGIN, test x"$ac_cv_enable_trayicon_plugin" = xyes)
374 if test x"$ac_cv_enable_trayicon_plugin" = xyes; then
375 PLUGINS="trayicon $PLUGINS"
378 AC_ARG_ENABLE(spamassassin-plugin,
379 [ --enable-spamassassin-plugin Build SpamAssassin plugin [default=no]],
380 [ac_cv_enable_spamassassin_plugin=$enableval], [ac_cv_enable_spamassassin_plugin=no])
381 AM_CONDITIONAL(BUILD_SPAMASSASSIN_PLUGIN, test x"$ac_cv_enable_spamassassin_plugin" = xyes)
382 if test x"$ac_cv_enable_spamassassin_plugin" = xyes; then
384 PLUGINS="spamassassin $PLUGINS"
387 AC_ARG_ENABLE(mathml-viewer-plugin,
388 [ --enable-mathml-viewer-plugin Build MathML-Viewer plugin [default=no]],
389 [ac_cv_enable_mathml_viewer_plugin=$enableval], [ac_cv_enable_mathml_viewer_plugin=no])
390 AM_CONDITIONAL(BUILD_MATHML_VIEWER_PLUGIN, test x"$ac_cv_enable_mathml_viewer_plugin" = xyes)
391 if test x"$ac_cv_enable_mathml_viewer_plugin" = xyes; then
392 GTK_MATH_VIEW_CFLAGS=$( gtkmathview-config --cflags )
393 GTK_MATH_VIEW_LIBS=$( gtkmathview-config --libs )
394 AC_SUBST(GTK_MATH_VIEW_CFLAGS)
395 AC_SUBST(GTK_MATH_VIEW_LIBS)
397 PLUGINS="mathml-viewer $PLUGINS"
400 AC_ARG_ENABLE(image-viewer-plugin,
401 [ --disable-image-viewer-plugin Do not build image viewer plugin],
402 [ac_cv_enable_image_viewer_plugin=$enableval], [ac_cv_enable_image_viewer_plugin=yes])
403 if test x"$ac_cv_enable_image_viewer_plugin" = xyes; then
404 AC_ARG_ENABLE(gdk-pixbuf,
405 [ --disable-gdk-pixbuf Do not use gdk-pixbuf],
406 [ac_cv_enable_gdk_pixbuf=$enableval], [ac_cv_enable_gdk_pixbuf=yes])
408 [ --disable-imlib Do not use imlib],
409 [ac_cv_enable_imlib=$enableval], [ac_cv_enable_imlib=yes])
411 if test "$ac_cv_enable_gdk_pixbuf" = yes; then
412 AM_PATH_GDK_PIXBUF(0.8.0,
413 [AC_DEFINE(HAVE_GDK_PIXBUF, 1, Define if you use gdk-pixbuf to support image viewer)
414 ac_cv_enable_imlib=no], [ac_cv_enable_gdk_pixbuf=no])
416 if test "$ac_cv_enable_imlib" = yes; then
417 AM_PATH_GDK_IMLIB(1.9,
418 AC_DEFINE(HAVE_GDK_IMLIB, 1, Define if you use gdk_imlib to support image viewer),
419 [ac_cv_enable_imlib=no])
421 if test "$ac_cv_enable_gdk_pixbuf" = no -a "$ac_cv_enable_imlib" = no; then
422 $ac_cv_enable_image_viewer_plugin = no
425 AM_CONDITIONAL(BUILD_IMAGE_VIEWER_PLUGIN, test x"$ac_cv_enable_image_viewer_plugin" = xyes)
426 if test x"$ac_cv_enable_image_viewer_plugin" = xyes; then
427 if test "$ac_cv_enable_gdk_pixbuf" = yes; then
428 PLUGINS="image-viewer(gdk-pixbuf) $PLUGINS"
429 elif test "$ac_cv_enable_imlib" = yes; then
430 PLUGINS="image-viewer(gdk_imlib) $PLUGINS"
434 AC_ARG_ENABLE(dillo-viewer-plugin,
435 [ --enable-dillo-viewer-plugin Build Dillo plugin for html mail rendering [default=no]],
436 [ac_cv_enable_dillo_viewer_plugin=$enableval], [ac_cv_enable_dillo_viewer_plugin=no])
437 AM_CONDITIONAL(BUILD_DILLO_VIEWER_PLUGIN, test x"$ac_cv_enable_dillo_viewer_plugin" = xyes)
438 if test x"$ac_cv_enable_dillo_viewer_plugin" = xyes; then
439 PLUGINS="dillo-viewer $PLUGINS"
442 AC_ARG_ENABLE(demo-plugin,
443 [ --enable-demo-plugin Build demo plugin [default=no]],
444 [ac_cv_enable_demo_plugin=$enableval], [ac_cv_enable_demo_plugin=no])
445 AM_CONDITIONAL(BUILD_DEMO_PLUGIN, test x"$ac_cv_enable_demo_plugin" = xyes)
446 if test x"$ac_cv_enable_demo_plugin" = xyes; then
447 PLUGINS="demo $PLUGINS"
450 AC_ARG_ENABLE(clamav-plugin,
451 [ --enable-clamav-plugin Build Clam AntiVirus plugin [default=no]],
452 [ac_cv_enable_clamav_plugin=$enableval], [ac_cv_enable_clamav_plugin=no])
453 AM_CONDITIONAL(BUILD_CLAMAV_PLUGIN, test x"$ac_cv_enable_clamav_plugin" = xyes)
454 if test x"$ac_cv_enable_clamav_plugin" = xyes; then
455 AC_CHECK_LIB(clamav, cl_scanfile, clamav_lib=-lclamav)
456 if test -z "${clamav_lib}"
458 AC_MSG_ERROR(clamav library not found)
460 CLAMAV_LIBS="${clamav_lib}"
461 AC_SUBST(CLAMAV_LIBS)
463 PLUGINS="clamav $PLUGINS"
466 dnl ****************************
467 dnl ** Final configure output **
468 dnl ****************************
479 src/common/passcrypt.h
482 src/plugins/demo/Makefile
483 src/plugins/spamassassin/Makefile
484 src/plugins/mathml_viewer/Makefile
485 src/plugins/dillo_viewer/Makefile
486 src/plugins/image_viewer/Makefile
487 src/plugins/trayicon/Makefile
488 src/plugins/trayicon/libeggtrayicon/Makefile
489 src/plugins/clamav/Makefile
507 dnl Output the configuration summary
509 echo "$PACKAGE $VERSION"
511 echo "GnuPG : $ac_cv_enable_gpgme"
512 echo "JPilot : $ac_cv_enable_jpilot"
513 echo "LDAP : $ac_cv_enable_ldap"
514 echo "OpenSSL : $ac_cv_enable_openssl"
515 echo "iconv : $am_cv_func_iconv"
516 echo "compface : $ac_cv_enable_compface"
517 echo "IPv6 : $ac_cv_enable_ipv6"
518 echo "GNU/aspell : $ac_cv_enable_aspell"
519 echo "Crash dialog : $ac_cv_enable_crash_dialog"
520 echo "Plugins : $PLUGINS"
522 echo "The binary will be installed in $prefix/bin"
524 echo "Configure finished, type 'make' to build."