configure.ac 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130
  1. AC_PREREQ(2.60)
  2. AC_INIT(src/main.c)
  3. AC_CONFIG_AUX_DIR(config)
  4. AC_CONFIG_MACRO_DIR([m4])
  5. PACKAGE=claws-mail
  6. dnl version number
  7. MAJOR_VERSION=3
  8. MINOR_VERSION=7
  9. MICRO_VERSION=4
  10. INTERFACE_AGE=0
  11. BINARY_AGE=0
  12. EXTRA_VERSION=0
  13. EXTRA_RELEASE=
  14. EXTRA_GTK2_VERSION=
  15. if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
  16. VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}${EXTRA_RELEASE}${EXTRA_GTK2_VERSION}
  17. else
  18. VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}cvs${EXTRA_VERSION}${EXTRA_GTK2_VERSION}
  19. fi
  20. dnl set $target
  21. AC_CANONICAL_SYSTEM
  22. dnl
  23. AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
  24. dnl AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
  25. dnl AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
  26. AC_SUBST(PACKAGE)
  27. AC_SUBST(VERSION)
  28. AC_SUBST(MAJOR_VERSION)
  29. AC_SUBST(MINOR_VERSION)
  30. AC_SUBST(MICRO_VERSION)
  31. AC_SUBST(EXTRA_VERSION)
  32. dnl GNOME installed?
  33. AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
  34. if test "$GNOME_CONFIG" != no; then
  35. gnomedatadir="`gnome-config --datadir`"
  36. gnomeprefix="`gnome-config --prefix`"
  37. if test "${prefix}" = "NONE"; then
  38. gnomedatadir="${ac_default_prefix}/${gnomedatadir#${gnomeprefix}}"
  39. else
  40. gnomedatadir="${prefix}/${gnomedatadir#${gnomeprefix}}"
  41. fi
  42. AC_SUBST(gnomedatadir)
  43. fi
  44. AM_CONDITIONAL(CLAWS_GNOME, test -n "$gnomedatadir")
  45. AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  46. if test x$PKG_CONFIG = xno ; then
  47. AC_MSG_ERROR([*** pkg-config not found. See http://www.freedesktop.org/software/pkgconfig/])
  48. fi
  49. dnl GNOME 2.x installed?
  50. PKG_CHECK_MODULES(GNOME2, libgnome-2.0 >= 2.0, ac_enable_gnome2=yes, ac_enable_gnome2=no)
  51. AM_CONDITIONAL(CLAWS_GNOME2, test x"$ac_enable_gnome2" = x"yes")
  52. dnl libtool versioning
  53. LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
  54. LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
  55. LT_REVISION=$INTERFACE_AGE
  56. LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
  57. AC_SUBST(LT_RELEASE)
  58. AC_SUBST(LT_CURRENT)
  59. AC_SUBST(LT_REVISION)
  60. AC_SUBST(LT_AGE)
  61. dnl Specify a header configuration file
  62. AC_CONFIG_HEADERS(config.h)
  63. AM_MAINTAINER_MODE
  64. dnl Checks for programs.
  65. dnl AC_ARG_PROGRAM
  66. AC_PROG_CC
  67. AC_ISC_POSIX
  68. AC_PROG_INSTALL
  69. AC_PROG_LN_S
  70. AC_PROG_MAKE_SET
  71. AC_PROG_CPP
  72. dnl AC_PROG_RANLIB
  73. AM_PROG_LEX
  74. AC_PROG_YACC
  75. AC_LIB_PREFIX
  76. AC_LIBTOOL_WIN32_DLL
  77. LT_AC_PROG_RC
  78. AC_LIBTOOL_RC
  79. AC_PROG_LIBTOOL
  80. AC_SYS_LARGEFILE
  81. dnl ******************************
  82. dnl Checks for host
  83. dnl Not needed anymore because we
  84. dnl do AC_CANONICAL_SYSTEM above
  85. dnl ******************************
  86. dnl AC_CANONICAL_HOST
  87. dnl Copied from the official gtk+-2 configure.in
  88. AC_MSG_CHECKING([for some Win32 platform])
  89. case "$host" in
  90. *-*-mingw*|*-*-cygwin*)
  91. platform_win32=yes
  92. LDFLAGS="$LDFLAGS -mwindows"
  93. ;;
  94. *)
  95. platform_win32=no
  96. ;;
  97. esac
  98. AC_MSG_RESULT([$platform_win32])
  99. AM_CONDITIONAL(PLATFORM_WIN32, test x"$platform_win32" = x"yes")
  100. AC_MSG_CHECKING([for native Win32])
  101. case "$host" in
  102. *-*-mingw*)
  103. os_win32=yes
  104. ;;
  105. *)
  106. os_win32=no
  107. ;;
  108. esac
  109. AC_MSG_RESULT([$os_win32])
  110. AM_CONDITIONAL(OS_WIN32, test x"$os_win32" = x"yes")
  111. AC_MSG_CHECKING([for Cygwin])
  112. case "$host" in
  113. *-*-cygwin*)
  114. env_cygwin=yes
  115. ;;
  116. *)
  117. env_cygwin=no
  118. ;;
  119. esac
  120. AC_MSG_RESULT([$env_cygwin])
  121. AM_CONDITIONAL(CYGWIN, test x"$env_cygwin" = x"yes")
  122. if test "$GCC" = "yes"
  123. then
  124. CFLAGS="$CFLAGS -Wno-unused-function"
  125. fi
  126. AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
  127. _gcc_cflags_save=$CFLAGS
  128. CFLAGS="-Wno-pointer-sign"
  129. AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),_gcc_psign=yes,_gcc_psign=no)
  130. AC_MSG_RESULT($_gcc_psign)
  131. CFLAGS=$_gcc_cflags_save;
  132. if test x"$_gcc_psign" = xyes ; then
  133. CFLAGS="$CFLAGS -Wno-pointer-sign"
  134. fi
  135. CFLAGS="$CFLAGS -Wall"
  136. if test $USE_MAINTAINER_MODE = yes; then
  137. CFLAGS="$CFLAGS -DGTK_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DG_DISABLE_DEPRECATED -DGTK_DISABLE_SINGLE_INCLUDES"
  138. fi
  139. pthread_name=
  140. case "$target" in
  141. *-darwin*)
  142. CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
  143. ;;
  144. *-*-mingw*)
  145. # Note that we need to link to pthreadGC2 in all cases. This
  146. # is because some locking is used even when pthread support is
  147. # disabled.
  148. pthread_name=pthreadGC2
  149. CFLAGS="$CFLAGS -mms-bitfields"
  150. LIBS="$LIBS -l${pthread_name} -lws2_32 -lregex"
  151. ;;
  152. *-*-solaris*)
  153. CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
  154. CFLAGS="$CFLAGS -DSOLARIS"
  155. ;;
  156. esac
  157. dnl Checks for iconv
  158. AM_ICONV
  159. dnl
  160. dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
  161. dnl
  162. syl_save_LIBS=$LIBS
  163. LIBS="$LIBS $GTK_LIBS"
  164. AC_CHECK_FUNCS(bind_textdomain_codeset)
  165. LIBS=$syl_save_LIBS
  166. dnl for gettext
  167. ALL_LINGUAS="bg ca cs de en_GB es fi fr hu id it ja nl pl pt_BR pt_PT ru sk sv zh_CN"
  168. GETTEXT_PACKAGE=claws-mail
  169. AC_SUBST(GETTEXT_PACKAGE)
  170. AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define text domain.])
  171. AM_GNU_GETTEXT_VERSION([0.15])
  172. AM_GNU_GETTEXT([external])
  173. manualdir='${docdir}/manual'
  174. AC_ARG_WITH(manualdir,
  175. [ --with-manualdir=DIR Manual directory],
  176. [manualdir="$withval"])
  177. AC_SUBST(manualdir)
  178. AC_ARG_ENABLE(manual,
  179. [ --disable-manual do not build manual],
  180. [ac_cv_enable_manual=$enableval], [ac_cv_enable_manual=yes])
  181. AM_CONDITIONAL(BUILD_MANUAL, test x"$ac_cv_enable_manual" = xyes)
  182. dnl Set PACKAGE_DATA_DIR in config.h.
  183. if test "x${datarootdir}" = 'x${prefix}/share'; then
  184. if test "x${prefix}" = "xNONE"; then
  185. AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}",[PACKAGE_DATA_DIR])
  186. else
  187. AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}",[PACKAGE_DATA_DIR])
  188. fi
  189. else
  190. AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datarootdir}/${PACKAGE}",[PACKAGE_DATA_DIR])
  191. fi
  192. AC_CHECK_LIB(xpg4, setlocale)
  193. SM_LIBS=""
  194. dnl Check for LibSM
  195. AC_ARG_ENABLE(libsm,
  196. [ --disable-libsm disable libSM support for session management.],
  197. [ac_cv_enable_libsm=$enableval], [ac_cv_enable_libsm=yes])
  198. AC_MSG_CHECKING([whether to use LibSM])
  199. if test x"$ac_cv_enable_libsm" = xyes; then
  200. AC_MSG_RESULT(yes)
  201. AC_CHECK_LIB(SM, SmcSaveYourselfDone,
  202. [SM_LIBS="$X_LIBS -lSM -lICE"],ac_cv_enable_libsm=no,
  203. $X_LIBS -lICE)
  204. AC_CHECK_HEADERS(X11/SM/SMlib.h,,ac_cv_enable_libsm=no)
  205. if test x"$ac_cv_enable_libsm" = xyes; then
  206. AC_DEFINE(HAVE_LIBSM, 1, [Define to 1 if you have libSM installed])
  207. else
  208. AC_MSG_RESULT(not found)
  209. AC_MSG_WARN([*** LibSM will not be supported ***])
  210. fi
  211. else
  212. AC_MSG_RESULT(no)
  213. fi
  214. AC_SUBST(SM_LIBS)
  215. dnl for GThread support (currently disabled)
  216. dnl AC_ARG_ENABLE(threads,
  217. dnl [ --enable-threads Enable multithread support [default=no]],
  218. dnl [use_threads=$enableval], [use_threads=no])
  219. AC_MSG_CHECKING([whether to use threads])
  220. if test x"$use_threads" = xyes ; then
  221. AC_MSG_RESULT(yes)
  222. if test ! -z `$GLIB_CONFIG --help 2>&1 |grep 'gthread'` ; then
  223. CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
  224. LIBS="$LIBS `$GLIB_CONFIG --libs gthread`"
  225. AC_DEFINE(USE_THREADS, 1, Whether to use multithread or not)
  226. else
  227. AC_MSG_ERROR([Sylpheed requires GThread from GLib to use threading.])
  228. fi
  229. else
  230. AC_MSG_RESULT(no)
  231. fi
  232. dnl Check for d_type member in struct dirent
  233. AC_MSG_CHECKING([whether struct dirent has d_type member])
  234. AC_CACHE_VAL(ac_cv_dirent_d_type,[
  235. AC_TRY_COMPILE([#include <dirent.h>],
  236. [struct dirent d; d.d_type = DT_REG;],
  237. ac_cv_dirent_d_type=yes, ac_cv_dirent_d_type=no)
  238. ])
  239. AC_MSG_RESULT($ac_cv_dirent_d_type)
  240. if test $ac_cv_dirent_d_type = yes; then
  241. AC_DEFINE(HAVE_DIRENT_D_TYPE, 1,
  242. Define if `struct dirent' has `d_type' member.)
  243. fi
  244. # Check whether mkdir does not take the permission argument.
  245. GNUPG_FUNC_MKDIR_TAKES_ONE_ARG
  246. dnl Checks for header files.
  247. AC_HEADER_DIRENT
  248. AC_HEADER_STDC
  249. AC_HEADER_SYS_WAIT
  250. AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
  251. sys/param.h sys/utsname.h sys/select.h \
  252. wchar.h wctype.h locale.h netdb.h)
  253. AC_CHECK_HEADER([execinfo.h], [AC_DEFINE(HAVE_BACKTRACE,1,[Has backtrace*() needed for retrieving stack traces])])
  254. AC_SEARCH_LIBS(backtrace_symbols, [execinfo])
  255. dnl alf - Check for apache installation f*ck up. apache may also install an
  256. dnl fnmatch, which includes their own regex stuff if USE_HSREGEX is defined
  257. AC_TRY_COMPILE([#include <stdlib.h>
  258. #include <fnmatch.h>],
  259. [int x = USE_HSREGEX;],
  260. ac_cv_have_apache_fnmatch=yes, ac_cv_have_apache_fnmatch=no)
  261. if test $ac_cv_have_apache_fnmatch = yes; then
  262. AC_DEFINE(HAVE_APACHE_FNMATCH, 1, Define if you need to work around apache regex/fnmatch !KLUDGE!)
  263. fi
  264. AC_MSG_CHECKING([whether to use Apache regex header kludge])
  265. AC_MSG_RESULT($ac_cv_have_apache_fnmatch)
  266. dnl Checks for typedefs, structures, and compiler characteristics.
  267. AC_C_CONST
  268. AC_TYPE_OFF_T
  269. AC_TYPE_PID_T
  270. AC_TYPE_SIZE_T
  271. AC_STRUCT_TM
  272. dnl AC_CHECK_TYPE(wint_t, unsigned int) does not work because wint_t
  273. dnl may be defined only in wchar.h (this happens with gcc-2.96).
  274. dnl So we need to use this extended macro.
  275. CLAWS_CHECK_TYPE(wint_t, unsigned int,
  276. [
  277. #if HAVE_WCHAR_H
  278. #include <wchar.h>
  279. #endif
  280. ], Define to `unsigned int' if <stddef.h> or <wchar.h> doesn't define.)
  281. GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF, Used to test for a u32 typedef)
  282. AC_CHECK_SIZEOF(unsigned short, 2)
  283. AC_CHECK_SIZEOF(unsigned int, 4)
  284. AC_CHECK_SIZEOF(unsigned long, 4)
  285. dnl Checks for library functions.
  286. AC_FUNC_ALLOCA
  287. AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr strchr \
  288. uname flock lockf inet_aton inet_addr \
  289. fchmod mkstemp truncate getuid regcomp)
  290. AC_CHECK_FUNCS(fgets_unlocked fwrite_unlocked)
  291. dnl *****************
  292. dnl ** common code **
  293. dnl *****************
  294. dnl check for glib
  295. PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.6 gmodule-2.0 >= 2.6 gobject-2.0 >= 2.6 gthread-2.0 >= 2.6)
  296. GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
  297. AC_SUBST(GLIB_GENMARSHAL)
  298. AC_SUBST(GLIB_CFLAGS)
  299. AC_SUBST(GLIB_LIBS)
  300. dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
  301. syl_save_LIBS=$LIBS
  302. LIBS="$LIBS $GTK_LIBS"
  303. AC_CHECK_FUNCS(bind_textdomain_codeset)
  304. LIBS=$syl_save_LIBS
  305. dnl check for IPv6 option
  306. AC_ARG_ENABLE(ipv6,
  307. [ --disable-ipv6 disable build IPv6 support],
  308. [ac_cv_enable_ipv6=$enableval], [ac_cv_enable_ipv6=yes])
  309. dnl automated checks for IPv6 support.
  310. AC_MSG_CHECKING([whether to use IPv6])
  311. if test x"$ac_cv_enable_ipv6" = xyes; then
  312. AC_MSG_RESULT(yes)
  313. AC_MSG_CHECKING([for IPv6 support])
  314. AC_CACHE_VAL(ac_cv_ipv6,[
  315. AC_TRY_COMPILE([#define INET6
  316. #include <sys/types.h>
  317. #include <netinet/in.h>],
  318. [int x = IPPROTO_IPV6; struct in6_addr a;],
  319. ac_cv_ipv6=yes, ac_cv_ipv6=no)
  320. ])
  321. AC_MSG_RESULT($ac_cv_ipv6)
  322. if test $ac_cv_ipv6 = yes; then
  323. AC_DEFINE(INET6, 1, Define if you want IPv6 support.)
  324. else
  325. AC_MSG_WARN(*** IPv6 will not be supported ***)
  326. ac_cv_enable_ipv6=no
  327. fi
  328. else
  329. AC_MSG_RESULT(no)
  330. fi
  331. dnl GNUTLS
  332. AC_MSG_CHECKING([whether to use GnuTLS])
  333. AC_ARG_ENABLE(openssl, [ --enable-openssl enable GnuTLS support],
  334. [ac_cv_enable_openssl=$enableval], [ac_cv_enable_openssl=no])
  335. AC_ARG_ENABLE(gnutls, [ --enable-gnutls enable GnuTLS support],
  336. [ac_cv_enable_gnutls=$enableval], [ac_cv_enable_gnutls=yes])
  337. if test "x$ac_cv_enable_gnutls" != "xyes"; then
  338. if test "x$ac_cv_enable_openssl" = "xyes"; then
  339. AC_MSG_ERROR(*** Use GnuTLS instead of OpenSSL due to licensing ***)
  340. fi
  341. fi
  342. AC_MSG_RESULT($ac_cv_enable_gnutls)
  343. if test "x$ac_cv_enable_gnutls" != "xno"; then
  344. OCPPFLAGS="$CPPFLAGS"
  345. OLDFLAGS="$LDFLAGS"
  346. GNUTLS_LIBS=""
  347. PKG_CHECK_MODULES(GNUTLS, gnutls >= 2.0.3,
  348. [ac_cv_enable_gnutls=yes],
  349. [ac_cv_enable_gnutls=no
  350. echo "GnuTLS version >= 2.0.3 not found"])
  351. if test "x$ac_cv_enable_gnutls" = "xyes"; then
  352. AC_CHECK_HEADER(gpg-error.h,
  353. [AC_CHECK_LIB(gpg-error, gpg_strerror,,
  354. [ac_cv_enable_gnutls=no])
  355. ],[ac_cv_enable_gnutls=no])
  356. fi
  357. if test "x$ac_cv_enable_gnutls" = "xyes"; then
  358. GCRYPT_LIBS="-lgpg-error"
  359. AC_CHECK_HEADER(gcrypt.h,
  360. [AC_CHECK_LIB(gcrypt, gcry_control,,
  361. [ac_cv_enable_gnutls=no])
  362. ],[ac_cv_enable_gnutls=no])
  363. fi
  364. if test "x$ac_cv_enable_gnutls" = "xyes"; then
  365. if test x"$platform_win32" = "xyes"; then
  366. GNUTLS_LIBS="-lgnutls -lgcrypt ${GCRYPT_LIBS}"
  367. else
  368. GNUTLS_LIBS="-lgnutls -lgcrypt -lz ${GCRYPT_LIBS}"
  369. fi
  370. fi
  371. else
  372. CPPFLAGS="$OCPPFLAGS"
  373. LDFLAGS="$OLDFLAGS"
  374. fi
  375. if test "x$ac_cv_enable_gnutls" = "xyes"; then
  376. AC_DEFINE([USE_GNUTLS],1, [Define to use GnuTLS])
  377. else
  378. GNUTLS_LIBS=""
  379. fi
  380. AC_SUBST(GNUTLS_LIBS)
  381. dnl password encryption
  382. OLDLIBS=$LIBS
  383. LIBS=
  384. case $host_os in
  385. *dragonfly*)
  386. AC_SEARCH_LIBS(encrypt, cipher, [], AC_MSG_ERROR(['encrypt'-function not found.]))
  387. ;;
  388. *)
  389. AC_SEARCH_LIBS(encrypt, crypt, [], AC_MSG_ERROR(['encrypt'-function not found.]))
  390. ;;
  391. esac
  392. CRYPT_LIBS=$LIBS
  393. AC_SUBST(CRYPT_LIBS)
  394. LIBS=$OLDLIBS
  395. AC_ARG_WITH(passcrypt-key, [ --with-passcrypt-key=KEY Key used to encode passwords (8 byte string)],
  396. with_passcrypt_key="$withval", with_passcrypt_key="passkey0")
  397. AC_SUBST(PASSCRYPT_KEY, $with_passcrypt_key)
  398. dnl RC dir (will be default at a certain point in time)
  399. AC_ARG_WITH(config-dir, [ --with-config-dir=RCDIR Local configuration dir (default: .claws-mail)],
  400. ac_cv_with_config_dir="$withval", ac_cv_with_config_dir=".claws-mail")
  401. if test x"$ac_cv_with_config_dir" = x""; then
  402. ac_cv_with_config_dir=".claws-mail"
  403. fi
  404. AC_DEFINE_UNQUOTED(CFG_RC_DIR, "$ac_cv_with_config_dir", Configuration directory)
  405. dnl ************************
  406. dnl ** GTK user interface **
  407. dnl ************************
  408. dnl Checks for GTK
  409. PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.6)
  410. dnl --disable-deprecated switch for GTK2 purification
  411. AC_ARG_ENABLE(deprecated, [ --disable-deprecated disable deprecated GTK functions. ],
  412. [GTK_CFLAGS="$GTK_CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"], [])
  413. AC_SUBST(GTK_CFLAGS)
  414. AC_SUBST(GTK_LIBS)
  415. dnl enchant is used for spell checking
  416. AC_MSG_CHECKING([whether to use enchant])
  417. AC_ARG_ENABLE(enchant,
  418. [ --disable-enchant disable enchant support],
  419. [ac_cv_enable_enchant=$enableval], [ac_cv_enable_enchant=yes])
  420. AC_MSG_RESULT($ac_cv_enable_enchant)
  421. if test $ac_cv_enable_enchant = yes; then
  422. PKG_CHECK_MODULES(ENCHANT, enchant >= 1.0.0,
  423. [
  424. AC_DEFINE(USE_ENCHANT, 1, enchant)
  425. echo "Building with enchant"
  426. ac_cv_enable_enchant=yes
  427. CFLAGS="$CFLAGS `$PKG_CONFIG --cflags enchant`"
  428. ],
  429. [
  430. echo "Building without enchant-notification"
  431. ac_cv_enable_enchant=no
  432. ])
  433. AC_SUBST(ENCHANT_CFLAGS)
  434. AC_SUBST(ENCHANT_LIBS)
  435. fi
  436. dnl want crash dialog
  437. AC_ARG_ENABLE(crash-dialog,
  438. [ --enable-crash-dialog Enable crash dialog [default=no]],
  439. [ac_cv_enable_crash_dialog=$enableval], [ac_cv_enable_crash_dialog=no])
  440. if test $ac_cv_enable_crash_dialog = yes; then
  441. dnl check if GDB is somewhere
  442. AC_CHECK_PROG(ac_cv_enable_crash_dialog, gdb, yes, no)
  443. AC_MSG_CHECKING([whether to use crash dialog])
  444. if test $ac_cv_enable_crash_dialog = yes; then
  445. AC_DEFINE(CRASH_DIALOG, 1, Pop up crash dialog)
  446. fi
  447. AC_MSG_RESULT($ac_cv_enable_crash_dialog)
  448. fi
  449. dnl generic umpc
  450. AC_ARG_ENABLE(generic-umpc,
  451. [ --enable-generic-umpc Enable generic UMPC code [default=no]],
  452. [ac_cv_enable_generic_umpc=$enableval], [ac_cv_enable_generic_umpc=no])
  453. if test $ac_cv_enable_generic_umpc = yes; then
  454. AC_DEFINE(GENERIC_UMPC, 1, Generic UMPC code)
  455. AC_MSG_RESULT($ac_cv_enable_generic_umpc)
  456. fi
  457. dnl Maemo platform
  458. AC_ARG_ENABLE(maemo,
  459. [ --enable-maemo build for the Maemo platform [default=no]],
  460. [ac_cv_enable_maemo=$enableval], [ac_cv_enable_maemo=no])
  461. if test $ac_cv_enable_maemo = yes; then
  462. PKG_CHECK_MODULES(MAEMO, libosso hildon-libs hildon-fm gnome-vfs-2.0, ac_cv_enable_maemo=yes,
  463. ac_cv_enable_maemo=no)
  464. AC_SUBST(MAEMO_CFLAGS)
  465. AC_SUBST(MAEMO_LIBS)
  466. if test $ac_cv_enable_maemo = no; then
  467. #test for chinook
  468. PKG_CHECK_MODULES(MAEMO, libosso hildon-1 hildon-fm-2 gnome-vfs-2.0 hal, ac_cv_enable_maemo=yes,
  469. ac_cv_enable_maemo=no)
  470. AC_SUBST(MAEMO_CFLAGS)
  471. AC_SUBST(MAEMO_LIBS)
  472. if test $ac_cv_enable_maemo = no; then
  473. AC_MSG_ERROR(one of libosso hildon-libs hildon-fm hildon-1 hildon-fm-2 not found)
  474. else
  475. AC_DEFINE(MAEMO, 1, Build for maemo)
  476. AC_DEFINE(CHINOOK, 1, Maemo chinook)
  477. AC_DEFINE(GENERIC_UMPC, 1, Generic UMPC code)
  478. ac_cv_enable_generic_umpc=yes
  479. fi
  480. else
  481. AC_DEFINE(MAEMO, 1, Build for maemo)
  482. AC_DEFINE(GENERIC_UMPC, 1, Generic UMPC code)
  483. ac_cv_enable_generic_umpc=yes
  484. fi
  485. fi
  486. PKG_CHECK_MODULES(CONIC, conic, ac_cv_enable_conic=yes,
  487. ac_cv_enable_conic=no)
  488. AC_SUBST(CONIC_CFLAGS)
  489. AC_SUBST(CONIC_LIBS)
  490. if test $ac_cv_enable_conic = yes; then
  491. AC_DEFINE(CONIC, 1, Have conic lib)
  492. fi
  493. dnl Check for X-Face support
  494. AC_ARG_ENABLE(compface,
  495. [ --disable-compface disable compface (X-Face) support],
  496. [ac_cv_enable_compface=$enableval], [ac_cv_enable_compface=yes])
  497. AC_MSG_CHECKING([whether to use compface])
  498. if test x"$ac_cv_enable_compface" = xyes; then
  499. AC_MSG_RESULT(yes)
  500. AC_CHECK_LIB(compface, uncompface,
  501. [AC_DEFINE(HAVE_LIBCOMPFACE, 1, Define if you want compface support.)],
  502. [ac_cv_enable_compface=no])
  503. if test x"$ac_cv_enable_compface" = xyes; then
  504. COMPFACE_LIBS="-lcompface"
  505. else
  506. COMPFACE_LIBS=""
  507. fi
  508. AC_SUBST(COMPFACE_LIBS)
  509. else
  510. AC_MSG_RESULT(no)
  511. fi
  512. dnl check for pthread support
  513. AC_ARG_ENABLE(pthread,
  514. [ --disable-pthread disable pthread support],
  515. [ac_cv_enable_pthread=$enableval], [ac_cv_enable_pthread=yes])
  516. AC_MSG_CHECKING([whether to use pthread])
  517. if test x$ac_cv_enable_pthread = xno; then
  518. AC_MSG_RESULT(no)
  519. else
  520. AC_MSG_RESULT(yes)
  521. # For W32 we need to use a special ptrhead lib. In this case we can't
  522. # use AC_CHECK_LIB because it has no means of checking for a
  523. # library installed under a different name. Checking for the
  524. # header is okay.
  525. if test -n "${pthread_name}" ; then
  526. ac_cv_enable_pthread=yes
  527. else
  528. AC_CHECK_LIB(pthread, pthread_create, :, ac_cv_enable_pthread=no)
  529. fi
  530. AC_CHECK_HEADERS(pthread.h, :, ac_cv_enable_pthread=no)
  531. if test x$ac_cv_enable_pthread = xyes; then
  532. AC_DEFINE(USE_PTHREAD, 1, Define if you have pthread)
  533. if test -z "${pthread_name}" ; then
  534. PTHREAD_LIBS="-lpthread"
  535. fi
  536. fi
  537. fi
  538. AC_SUBST(PTHREAD_LIBS)
  539. dnl
  540. dnl Check whether we need to pass -lresolv
  541. dnl We know that we don't need it for W32.
  542. dnl
  543. if test x$os_win32 = xno; then
  544. t_oldLibs="$LIBS"
  545. LIBS="$LIBS"
  546. ac_cv_var__res_options=no
  547. AC_TRY_LINK([#include <sys/types.h>
  548. #include <sys/socket.h>
  549. #include <netinet/in.h>
  550. #include <arpa/nameser.h>
  551. #include <resolv.h>],
  552. [_res.options = RES_INIT;],
  553. ac_cv_var__res_options=yes);
  554. if test "$ac_cv_var__res_options" != "yes"; then
  555. LIBRESOLV="-lresolv"
  556. fi
  557. LIBS="$t_oldLibs"
  558. if test "x$LIBRESOLV" = "x"; then
  559. AC_CHECK_LIB(resolv, res_query, [LIBRESOLV=-lresolv])
  560. LIBS="$t_oldLibs"
  561. fi
  562. fi
  563. AC_SUBST(LIBRESOLV)
  564. LIBS="$LIBS $LIBRESOLV"
  565. dnl for LDAP support in addressbook
  566. dnl no check for libraries; dynamically loaded
  567. AC_ARG_ENABLE(ldap,
  568. [ --disable-ldap disable LDAP support],
  569. [ac_cv_enable_ldap=$enableval], [ac_cv_enable_ldap=yes])
  570. AC_MSG_CHECKING([whether to use LDAP])
  571. if test x"$ac_cv_enable_ldap" = xno; then
  572. AC_MSG_RESULT(no)
  573. elif test x"$ac_cv_enable_ldap" = xyes -a x"$ac_cv_enable_pthread" = xno; then
  574. AC_MSG_RESULT(no - LDAP support needs pthread support)
  575. ac_cv_enable_ldap=no
  576. else
  577. AC_MSG_RESULT(yes)
  578. dnl check for available libraries, and pull them in
  579. AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="$LDAP_LIBS -lresolv")
  580. AC_CHECK_LIB(socket, bind, LDAP_LIBS="$LDAP_LIBS -lsocket")
  581. AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl")
  582. AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS="$LDAP_LIBS -llber",,
  583. $LDAP_LIBS)
  584. AC_CHECK_HEADERS(ldap.h lber.h,
  585. [ ac_cv_enable_ldap=yes ],
  586. [ ac_cv_enable_ldap=no ])
  587. if test "$ac_cv_enable_ldap" = yes; then
  588. AC_CHECK_LIB(ldap, ldap_open,
  589. [ ac_cv_enable_ldap=yes ],
  590. [ ac_cv_enable_ldap=no ],
  591. $LDAP_LIBS)
  592. AC_CHECK_LIB(ldap, ldap_start_tls_s,
  593. [ ac_cv_have_tls=yes ],
  594. [ ac_cv_have_tls=no ])
  595. fi
  596. AC_MSG_CHECKING([whether ldap library is available])
  597. AC_MSG_RESULT($ac_cv_enable_ldap)
  598. AC_MSG_CHECKING([whether TLS library is available])
  599. AC_MSG_RESULT($ac_cv_have_tls)
  600. if test "$ac_cv_enable_ldap" = yes; then
  601. AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
  602. LDAP_LIBS="$LDAP_LIBS -lldap"
  603. AC_SUBST(LDAP_LIBS)
  604. if test "$ac_cv_have_tls" = yes; then
  605. AC_DEFINE(USE_LDAP_TLS, 1, Define if you want LDAP TLS support in addressbook.)
  606. fi
  607. dnl As of OpenLDAP API version 3000 a number of functions has
  608. dnl been deprecated. As Claws-mail compiles and runs on many
  609. dnl platforms and many versions of OpenLDAP we need to be able
  610. dnl to switch between the old and new API because new API has
  611. dnl added new functions replacing old ones and at the same time
  612. dnl old functions has been changed.
  613. dnl If cross-compiling defaults to enable deprecated features
  614. dnl for maximum portability
  615. AC_MSG_CHECKING([The API version of OpenLDAP])
  616. AC_RUN_IFELSE(
  617. [AC_LANG_PROGRAM(
  618. [#include <ldap.h>],
  619. [if (LDAP_API_VERSION >= 3000)
  620. return 1
  621. ])],
  622. [AC_MSG_RESULT([version < 3000])
  623. AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 0, Define if OpenLDAP API is at least version 3000.)],
  624. [AC_MSG_RESULT([version >= 3000])
  625. AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 1, Define if OpenLDAP API is at least version 3000.)],
  626. [AC_MSG_RESULT([Enabling deprecated features in OpenLDAP])
  627. AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 0, Define if OpenLDAP API is at least version 3000.)
  628. AC_DEFINE(LDAP_DEPRECATED, 1, Define to activate deprecated features in OpenLDAP)]
  629. )
  630. fi
  631. fi
  632. dnl for JPilot support in addressbook
  633. dnl no check for libraries; these are dynamically loaded
  634. AC_ARG_ENABLE(jpilot,
  635. [ --disable-jpilot disable JPilot support],
  636. [ac_cv_enable_jpilot=$enableval], [ac_cv_enable_jpilot=yes])
  637. AC_MSG_CHECKING([whether to use JPilot])
  638. if test "$ac_cv_enable_jpilot" = yes; then
  639. AC_MSG_RESULT(yes)
  640. AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h pi-version.h,
  641. [ AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ],
  642. [ ac_cv_enable_jpilot=no ])
  643. if test "$ac_cv_enable_jpilot" = no; then
  644. AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h libpisock/pi-version.h,
  645. [ ac_cv_enable_jpilot=yes
  646. AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ])
  647. fi
  648. AC_CHECK_LIB(pisock, unpack_Address, [JPILOT_LIBS="-lpisock"], [JPILOT_LIBS="" ac_cv_enable_jpilot="no"])
  649. if test x"$ac_cv_enable_jpilot" = xyes; then
  650. AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.)
  651. else
  652. AC_MSG_NOTICE([JPilot support not available])
  653. fi
  654. AC_SUBST(JPILOT_LIBS)
  655. else
  656. AC_MSG_RESULT(no)
  657. fi
  658. dnl #######################################################################
  659. dnl # Check for startup notification
  660. dnl #######################################################################
  661. AC_ARG_ENABLE(startup-notification, [ --disable-startup-notification disable startup notification support],,enable_startup_notification=yes)
  662. if test "x$enable_startup_notification" = "xyes"; then
  663. PKG_CHECK_MODULES(STARTUP_NOTIFICATION, libstartup-notification-1.0 >= 0.5,
  664. [
  665. AC_DEFINE(HAVE_STARTUP_NOTIFICATION, 1, [Define if we're using libstartup-notification.])
  666. echo "Building with libstartup-notification"
  667. enable_startup_notification=yes
  668. ],
  669. [
  670. echo "Building without libstartup-notification"
  671. enable_startup_notification=no
  672. ])
  673. AC_SUBST(STARTUP_NOTIFICATION_CFLAGS)
  674. AC_SUBST(STARTUP_NOTIFICATION_LIBS)
  675. fi
  676. dnl #######################################################################
  677. dnl # Check for D-Bus support
  678. dnl #######################################################################
  679. AC_ARG_ENABLE(dbus, [ --disable-dbus disable dbus support],,enable_dbus=yes)
  680. if test "x$enable_dbus" = "xyes"; then
  681. PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.60, dbus-glib-1 >= 0.60],
  682. [
  683. AC_DEFINE(HAVE_DBUS_GLIB, 1, [Define if glib bindings of D-Bus are available])
  684. enable_dbus_glib=yes
  685. ],
  686. [
  687. echo "D-Bus requirements not met. D-Bus support not activated."
  688. enable_dbus_glib=no
  689. ])
  690. AC_SUBST(DBUS_CFLAGS)
  691. AC_SUBST(DBUS_LIBS)
  692. fi
  693. dnl #######################################################################
  694. dnl # Check for NetworkManager support
  695. dnl #######################################################################
  696. if test x"$enable_dbus_glib" = xyes; then
  697. AC_ARG_ENABLE(networkmanager-support, [ --disable-networkmanager-support disable NetworkManager support],,enable_networkmanager_support=yes)
  698. if test x"$enable_networkmanager_support" = xyes; then
  699. PKG_CHECK_MODULES(NETWORKMANAGER_SUPPORT, NetworkManager >= 0.6.2,
  700. [
  701. AC_DEFINE(HAVE_NETWORKMANAGER_SUPPORT, 1, [Define if NetworkManager support is to be included.])
  702. echo "Building with NetworkManager support"
  703. enable_networkmanager_support=yes
  704. ],
  705. [
  706. echo "NetworkManager not found."
  707. enable_networkmanager_support=no
  708. ])
  709. AC_SUBST(NETWORKMANAGER_SUPPORT_CFLAGS)
  710. fi
  711. else
  712. echo "NetworkManager support deactivated as D-Bus requirements were not met."
  713. enable_networkmanager_support=no
  714. fi
  715. dnl *************************
  716. dnl ** section for plugins **
  717. dnl *************************
  718. PLUGINS=""
  719. dnl --- Trayicon ---
  720. AC_MSG_CHECKING([whether to build Trayicon plugin])
  721. AC_ARG_ENABLE(trayicon-plugin,
  722. [ --disable-trayicon-plugin do not build System Tray Icon plugin],
  723. [ac_cv_enable_trayicon_plugin=$enableval], [ac_cv_enable_trayicon_plugin=yes])
  724. if test x"$ac_cv_enable_trayicon_plugin" = xyes; then
  725. AC_MSG_RESULT(yes)
  726. PLUGINS="trayicon $PLUGINS"
  727. else
  728. AC_MSG_RESULT(no)
  729. fi
  730. AM_CONDITIONAL(BUILD_TRAYICON_PLUGIN, test x"$ac_cv_enable_trayicon_plugin" = xyes)
  731. dnl --- SpamAssassin ---
  732. AC_MSG_CHECKING([whether to build SpamAssassin plugin])
  733. AC_ARG_ENABLE(spamassassin-plugin,
  734. [ --disable-spamassassin-plugin do not build SpamAssassin plugin],
  735. [ac_cv_enable_spamassassin_plugin=$enableval], [ac_cv_enable_spamassassin_plugin=yes])
  736. if test x"$ac_cv_enable_spamassassin_plugin" = xyes; then
  737. AC_MSG_RESULT(yes)
  738. AC_SPAMASSASSIN
  739. PLUGINS="spamassassin $PLUGINS"
  740. AC_DEFINE(USE_SPAMASSASSIN_PLUGIN, 1, Define if spamassassin plugin is being built.)
  741. else
  742. AC_MSG_RESULT(no)
  743. fi
  744. AM_CONDITIONAL(BUILD_SPAMASSASSIN_PLUGIN, test x"$ac_cv_enable_spamassassin_plugin" = xyes)
  745. dnl --- Bogofilter ---
  746. AC_MSG_CHECKING([whether to build Bogofilter plugin])
  747. AC_ARG_ENABLE(bogofilter-plugin,
  748. [ --disable-bogofilter-plugin do not build bogofilter plugin],
  749. [ac_cv_enable_bogofilter_plugin=$enableval], [ac_cv_enable_bogofilter_plugin=yes])
  750. if test x"$ac_cv_enable_bogofilter_plugin" = xyes; then
  751. AC_MSG_RESULT(yes)
  752. PLUGINS="bogofilter $PLUGINS"
  753. AC_DEFINE(USE_BOGOFILTER_PLUGIN, 1, Define if bogofilter plugin is being built.)
  754. else
  755. AC_MSG_RESULT(no)
  756. fi
  757. AM_CONDITIONAL(BUILD_BOGOFILTER_PLUGIN, test x"$ac_cv_enable_bogofilter_plugin" = xyes)
  758. dnl --- PGP/CORE ---
  759. AC_MSG_CHECKING([whether to build PGP/CORE plugin])
  760. AC_ARG_ENABLE(pgpcore-plugin,
  761. [ --disable-pgpcore-plugin do not build PGP/Core plugin],
  762. [ac_cv_enable_pgpcore_plugin=$enableval], [ac_cv_enable_pgpcore_plugin=yes])
  763. if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
  764. AC_MSG_RESULT(yes)
  765. AM_PATH_GPGME(1.0.0, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.),
  766. [ac_cv_enable_pgpcore_plugin=no])
  767. if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
  768. PLUGINS="pgpcore $PLUGINS"
  769. AM_PATH_GPGME(1.1.1,
  770. AC_DEFINE(HAVE_GPGME_PKA_TRUST, 1,
  771. [Define if GPGME supports PKA.]))
  772. #needed to get GPGME_LIBS and al correctly
  773. AM_PATH_GPGME(1.0.0, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.),
  774. [ac_cv_enable_pgpcore_plugin=no])
  775. else
  776. AC_MSG_WARN([*** PGP/CORE plugin will not be built ***])
  777. fi
  778. else
  779. AC_MSG_RESULT(no)
  780. fi
  781. AM_CONDITIONAL(BUILD_PGPCORE_PLUGIN, test x"$ac_cv_enable_pgpcore_plugin" = xyes)
  782. AC_MSG_CHECKING([whether to build PGP/MIME plugin])
  783. AC_ARG_ENABLE(pgpmime-plugin,
  784. [ --disable-pgpmime-plugin do not build PGP/MIME plugin],
  785. [ac_cv_enable_pgpmime_plugin=$enableval], [ac_cv_enable_pgpmime_plugin=yes])
  786. if test x"$ac_cv_enable_pgpmime_plugin" = xyes; then
  787. AC_MSG_RESULT(yes)
  788. if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
  789. PLUGINS="pgpmime $PLUGINS"
  790. else
  791. AC_MSG_WARN([*** PGP/MIME plugin cannot be built ***])
  792. AC_MSG_WARN([*** without the PGP/CORE plugin ***])
  793. fi
  794. else
  795. AC_MSG_RESULT(no)
  796. fi
  797. AM_CONDITIONAL(BUILD_PGPMIME_PLUGIN, test x"$ac_cv_enable_pgpmime_plugin" = xyes)
  798. AC_MSG_CHECKING([whether to build PGP/Inline plugin])
  799. AC_ARG_ENABLE(pgpinline-plugin,
  800. [ --disable-pgpinline-plugin do not build PGP/Inline plugin],
  801. [ac_cv_enable_pgpinline_plugin=$enableval], [ac_cv_enable_pgpinline_plugin=yes])
  802. if test x"$ac_cv_enable_pgpinline_plugin" = xyes; then
  803. AC_MSG_RESULT(yes)
  804. if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
  805. PLUGINS="pgpinline $PLUGINS"
  806. else
  807. AC_MSG_WARN([*** PGP/Inline plugin cannot be built ***])
  808. AC_MSG_WARN([*** without the PGP/CORE plugin ***])
  809. fi
  810. else
  811. AC_MSG_RESULT(no)
  812. fi
  813. AM_CONDITIONAL(BUILD_PGPINLINE_PLUGIN, test x"$ac_cv_enable_pgpinline_plugin" = xyes)
  814. AC_MSG_CHECKING([whether to build S/Mime plugin])
  815. AC_ARG_ENABLE(smime-plugin,
  816. [ --disable-smime-plugin do not build S/Mime plugin],
  817. [ac_cv_enable_smime_plugin=$enableval], [ac_cv_enable_smime_plugin=yes])
  818. if test x"$ac_cv_enable_smime_plugin" = xyes; then
  819. AC_MSG_RESULT(yes)
  820. if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
  821. PLUGINS="smime $PLUGINS"
  822. else
  823. AC_MSG_WARN([*** S/Mime plugin cannot be built ***])
  824. AC_MSG_WARN([*** without the PGP/CORE plugin ***])
  825. fi
  826. else
  827. AC_MSG_RESULT(no)
  828. fi
  829. AM_CONDITIONAL(BUILD_SMIME_PLUGIN, test x"$ac_cv_enable_smime_plugin" = xyes)
  830. dnl --- Dillo Viewer ---
  831. AC_MSG_CHECKING([whether to build Dillo plugin])
  832. AC_ARG_ENABLE(dillo-viewer-plugin,
  833. [ --disable-dillo-viewer-plugin do not build Dillo plugin for html mail rendering],
  834. [ac_cv_enable_dillo_viewer_plugin=$enableval], [ac_cv_enable_dillo_viewer_plugin=yes])
  835. if test x"$ac_cv_enable_dillo_viewer_plugin" = xyes; then
  836. AC_MSG_RESULT(yes)
  837. PLUGINS="dillo-viewer $PLUGINS"
  838. else
  839. AC_MSG_RESULT(no)
  840. fi
  841. AM_CONDITIONAL(BUILD_DILLO_VIEWER_PLUGIN, test x"$ac_cv_enable_dillo_viewer_plugin" = xyes)
  842. dnl --- Demo ---
  843. AC_ARG_ENABLE(demo-plugin,
  844. [ --enable-demo-plugin build demo plugin],
  845. [ac_cv_enable_demo_plugin=$enableval], [ac_cv_enable_demo_plugin=no])
  846. if test x"$ac_cv_enable_demo_plugin" = xyes; then
  847. PLUGINS="demo $PLUGINS"
  848. fi
  849. AM_CONDITIONAL(BUILD_DEMO_PLUGIN, test x"$ac_cv_enable_demo_plugin" = xyes)
  850. dnl Libetpan
  851. AC_MSG_CHECKING([whether to use libetpan])
  852. AC_ARG_ENABLE(libetpan,
  853. [ --disable-libetpan disable IMAP4/NNTP (libetpan) support],
  854. [ac_cv_enable_libetpan=$enableval], [ac_cv_enable_libetpan=yes])
  855. if test x"$ac_cv_enable_libetpan" = xyes; then
  856. AC_MSG_RESULT(yes)
  857. libetpan_result=no
  858. AC_PATH_PROG(libetpanconfig, [libetpan-config])
  859. if test "x$libetpanconfig" != "x"; then
  860. CPPFLAGS="$CPPFLAGS `$libetpanconfig --cflags 2>/dev/null`"
  861. AC_CHECK_HEADER(libetpan/libetpan.h, [libetpan_result=yes])
  862. if test "x$libetpan_result" = "xyes"; then
  863. AC_MSG_CHECKING([whether libetpan-config hints compiles and links fine])
  864. LIBS="$LIBS `$libetpanconfig --libs 2>/dev/null`"
  865. AC_TRY_LINK([#include <libetpan/dbstorage.h>], [db_mailstorage_init(NULL, NULL);], [libetpan_result=yes], [libetpan_result=no])
  866. AC_MSG_RESULT([$libetpan_result])
  867. fi
  868. fi
  869. if test "x$libetpan_result" = "xyes"; then
  870. LIBETPAN_CPPFLAGS="`$libetpanconfig --cflags`"
  871. LIBETPAN_LIBS="`$libetpanconfig --libs`"
  872. LIBETPAN_VERSION=`$libetpanconfig --version | sed "s/\.//g" | sed "s/-.*$//"`
  873. if test "$LIBETPAN_VERSION" -lt "057"; then
  874. AC_MSG_RESULT([*** Claws Mail requires libetpan 0.57 or newer. See http://www.etpan.org/])
  875. AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 and/or NNTP support.])
  876. AC_MSG_ERROR([libetpan 0.57 not found])
  877. fi
  878. AC_SUBST(LIBETPAN_FLAGS)
  879. AC_SUBST(LIBETPAN_LIBS)
  880. AC_DEFINE(HAVE_LIBETPAN, 1, Define if you want IMAP and/or NNTP support.)
  881. else
  882. AC_MSG_RESULT([*** Claws Mail requires libetpan 0.57 or newer. See http://www.etpan.org/ ])
  883. AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 and/or NNTP support.])
  884. AC_MSG_ERROR([libetpan 0.57 not found])
  885. fi
  886. else
  887. AC_MSG_RESULT(no)
  888. fi
  889. AM_CONDITIONAL(CLAWS_LIBETPAN, test "x$libetpan_result" = "xyes")
  890. dnl Printing support.
  891. PKG_CHECK_MODULES(GTK210, gtk+-2.0 >= 2.10, ac_cv_have_gtk210=yes, ac_cv_have_gtk210=no)
  892. AC_MSG_CHECKING([whether to use libgnomeprint])
  893. AC_ARG_ENABLE(gnomeprint,
  894. [ --disable-gnomeprint disable libgnomeprint support],
  895. [ac_cv_enable_gnomeprint=$enableval], [ac_cv_enable_gnomeprint=auto])
  896. if test x$ac_cv_have_gtk210 = xyes; then
  897. ac_cv_enable_gnomeprint="no"
  898. fi
  899. if test x$ac_cv_enable_gnomeprint = xyes \
  900. -o \( x$ac_cv_enable_gnomeprint = xauto \
  901. -a x$ac_cv_have_gtk210 = xno \); then
  902. AC_MSG_RESULT(yes)
  903. PKG_CHECK_MODULES(GNOMEPRINT, libgnomeprint-2.2 libgnomeprintui-2.2,
  904. ac_cv_enable_gnomeprint=yes, ac_cv_enable_gnomeprint=no)
  905. if test x"$ac_cv_enable_gnomeprint" = xyes; then
  906. AC_DEFINE(USE_GNOMEPRINT, 1, Define if you want libgnomeprint support)
  907. else
  908. AC_MSG_RESULT(not found)
  909. AC_MSG_WARN([*** libgnomeprintui wasn't found ***])
  910. AC_MSG_WARN([*** using built-in printing support ***])
  911. fi
  912. else
  913. ac_cv_enable_gnomeprint=no
  914. AC_MSG_RESULT(no)
  915. fi
  916. AM_CONDITIONAL(CLAWS_GNOMEPRINT, test x"$ac_cv_enable_gnomeprint" = x"yes")
  917. AC_MSG_CHECKING([whether to use valgrind])
  918. AC_ARG_ENABLE(valgrind,
  919. [ --disable-valgrind disable valgrind support for debugging],
  920. [ac_cv_enable_valgrind=$enableval], [ac_cv_enable_valgrind=yes])
  921. if test x$ac_cv_enable_valgrind = xyes; then
  922. AC_MSG_RESULT(yes)
  923. PKG_CHECK_MODULES(VALGRIND, valgrind >= 2.4.0,
  924. ac_cv_enable_valgrind=yes, ac_cv_enable_valgrind=no)
  925. if test x"$ac_cv_enable_valgrind" = xyes; then
  926. AC_DEFINE(HAVE_VALGRIND, 1, Define if you want valgrind support)
  927. else
  928. AC_MSG_RESULT(not found)
  929. fi
  930. else
  931. AC_MSG_RESULT(no)
  932. fi
  933. AM_CONDITIONAL(CLAWS_VALGRIND, test x"$ac_cv_enable_valgrind" = x"yes")
  934. dnl ****************************
  935. dnl ** Final configure output **
  936. dnl ****************************
  937. AC_OUTPUT([
  938. Makefile
  939. m4/Makefile
  940. po/Makefile.in
  941. src/common/version.h
  942. src/Makefile
  943. src/common/Makefile
  944. src/common/passcrypt.h
  945. src/gtk/Makefile
  946. src/etpan/Makefile
  947. src/plugins/Makefile
  948. src/plugins/demo/Makefile
  949. src/plugins/bogofilter/Makefile
  950. src/plugins/spamassassin/Makefile
  951. src/plugins/dillo_viewer/Makefile
  952. src/plugins/trayicon/Makefile
  953. src/plugins/trayicon/libeggtrayicon/Makefile
  954. src/plugins/pgpcore/Makefile
  955. src/plugins/pgpmime/Makefile
  956. src/plugins/pgpinline/Makefile
  957. src/plugins/smime/Makefile
  958. doc/Makefile
  959. doc/man/Makefile
  960. tools/Makefile
  961. config/Makefile
  962. manual/Makefile
  963. manual/dtd/Makefile
  964. manual/dist/Makefile
  965. manual/dist/pdf/Makefile
  966. manual/dist/ps/Makefile
  967. manual/dist/html/Makefile
  968. manual/dist/txt/Makefile
  969. manual/fr/Makefile
  970. manual/fr/dist/Makefile
  971. manual/fr/dist/pdf/Makefile
  972. manual/fr/dist/ps/Makefile
  973. manual/fr/dist/html/Makefile
  974. manual/fr/dist/txt/Makefile
  975. manual/pl/Makefile
  976. manual/pl/dist/Makefile
  977. manual/pl/dist/pdf/Makefile
  978. manual/pl/dist/ps/Makefile
  979. manual/pl/dist/html/Makefile
  980. manual/pl/dist/txt/Makefile
  981. manual/es/Makefile
  982. manual/es/dist/Makefile
  983. manual/es/dist/pdf/Makefile
  984. manual/es/dist/ps/Makefile
  985. manual/es/dist/html/Makefile
  986. manual/es/dist/txt/Makefile
  987. claws-mail.pc
  988. ])
  989. dnl Output the configuration summary
  990. echo ""
  991. echo "$PACKAGE $VERSION"
  992. echo ""
  993. echo "JPilot : $ac_cv_enable_jpilot"
  994. echo "LDAP : $ac_cv_enable_ldap"
  995. echo "gnuTLS : $ac_cv_enable_gnutls"
  996. echo "iconv : $am_cv_func_iconv"
  997. echo "compface : $ac_cv_enable_compface"
  998. echo "IPv6 : $ac_cv_enable_ipv6"
  999. echo "enchant : $ac_cv_enable_enchant"
  1000. echo "IMAP4 : $ac_cv_enable_libetpan"
  1001. echo "NNTP : $ac_cv_enable_libetpan"
  1002. echo "Crash dialog : $ac_cv_enable_crash_dialog"
  1003. echo "Libgnomeprint : $ac_cv_enable_gnomeprint"
  1004. echo "GTK+ print support: $ac_cv_have_gtk210"
  1005. echo "LibSM : $ac_cv_enable_libsm"
  1006. echo "DBUS : $enable_dbus"
  1007. echo "NetworkManager : $enable_networkmanager_support"
  1008. echo "Manual : $ac_cv_enable_manual"
  1009. echo "Plugins : $PLUGINS"
  1010. echo "Generic UMPC code : $ac_cv_enable_generic_umpc"
  1011. echo "Maemo build : $ac_cv_enable_maemo"
  1012. echo "Config dir : $ac_cv_with_config_dir"
  1013. echo ""
  1014. echo "The binary will be installed in $prefix/bin"
  1015. echo ""
  1016. echo "Configure finished, type 'make' to build."