configure.ac 68 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171
  1. AC_PREREQ(2.59)
  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. INTERFACE_AGE=0
  8. BINARY_AGE=0
  9. EXTRA_RELEASE=
  10. EXTRA_GTK3_VERSION=
  11. if test \( -d .git \); then
  12. AC_CHECK_PROG([GIT], [git], [yes], [no], [$PATH])
  13. if test \( "$GIT" = "no" \); then
  14. AC_MSG_ERROR([*** git not found. See http://git-scm.com/])
  15. else
  16. GIT_VERSION=`git describe --abbrev=6 --dirty --always`
  17. echo "echo ${GIT_VERSION}" > ./version
  18. fi
  19. else
  20. GIT_VERSION=`sh -c ". $srcdir/version"`
  21. fi
  22. if test \( -z "$GIT_VERSION" \); then
  23. AC_MSG_ERROR([*** could not determine program version])
  24. fi
  25. MAJOR_VERSION=${GIT_VERSION%%.*}
  26. MINOR_VERSION=${GIT_VERSION#*.}
  27. MINOR_VERSION=${MINOR_VERSION%%.*}
  28. MICRO_VERSION=${GIT_VERSION##*.}
  29. MICRO_VERSION=${MICRO_VERSION%%-*}
  30. EXTRA_VERSION=${GIT_VERSION#*-}
  31. EXTRA_VERSION=${EXTRA_VERSION%%-*}
  32. if test \( "x$EXTRA_VERSION" != "x" -a `echo -n $EXTRA_VERSION | wc -c` -lt 5 \); then
  33. VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}git${EXTRA_VERSION}
  34. else
  35. VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}
  36. EXTRA_VERSION=0
  37. fi
  38. if test \( "x$EXTRA_RELEASE" != "x" \); then
  39. VERSION=${VERSION}${EXTRA_RELEASE}${EXTRA_GTK3_VERSION}
  40. fi
  41. dnl set $target
  42. AC_CANONICAL_SYSTEM
  43. dnl
  44. AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
  45. dnl AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
  46. dnl AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
  47. AC_SUBST(PACKAGE)
  48. AC_SUBST(VERSION)
  49. AC_SUBST(MAJOR_VERSION)
  50. AC_SUBST(MINOR_VERSION)
  51. AC_SUBST(MICRO_VERSION)
  52. AC_SUBST(EXTRA_VERSION)
  53. AC_SUBST(GIT_VERSION)
  54. AC_CHECK_PROG(HAVE_GTK_ICON_CACHE, gtk-update-icon-cache, yes, no)
  55. AM_CONDITIONAL(UPDATE_GTK_ICON_CACHE, test x"$HAVE_GTK_ICON_CACHE" = xyes)
  56. dnl Require pkg-config
  57. m4_ifndef([PKG_PROG_PKG_CONFIG],
  58. [m4_fatal([Could not locate the pkg-config autoconf macros. These
  59. are usually located in /usr/share/aclocal/pkg.m4. If your macros
  60. are in a different location, try setting the environment variable
  61. ACLOCAL_FLAGS before running ./autogen.sh or autoreconf again. E.g.:
  62. export ACLOCAL_FLAGS="-I/other/macro/dir"])
  63. ])
  64. PKG_PROG_PKG_CONFIG
  65. dnl libtool versioning
  66. LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
  67. LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
  68. LT_REVISION=$INTERFACE_AGE
  69. LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
  70. AC_SUBST(LT_RELEASE)
  71. AC_SUBST(LT_CURRENT)
  72. AC_SUBST(LT_REVISION)
  73. AC_SUBST(LT_AGE)
  74. dnl Specify a header configuration file
  75. AC_CONFIG_HEADERS(config.h)
  76. AC_CONFIG_HEADERS(claws-features.h)
  77. AM_MAINTAINER_MODE
  78. dnl Checks for programs.
  79. dnl AC_ARG_PROGRAM
  80. AC_PROG_CC
  81. AC_ISC_POSIX
  82. AC_PROG_INSTALL
  83. AC_PROG_LN_S
  84. AC_PROG_MAKE_SET
  85. AC_PROG_CPP
  86. dnl AC_PROG_RANLIB
  87. AM_PROG_LEX
  88. AC_PROG_YACC
  89. AC_LIB_PREFIX
  90. AC_LIBTOOL_WIN32_DLL
  91. LT_INIT
  92. LT_AC_PROG_RC
  93. AC_LIBTOOL_RC
  94. AC_PROG_LIBTOOL
  95. AC_PROG_AWK
  96. AC_SYS_LARGEFILE
  97. dnl ******************************
  98. dnl Checks for host
  99. dnl Not needed anymore because we
  100. dnl do AC_CANONICAL_SYSTEM above
  101. dnl ******************************
  102. dnl AC_CANONICAL_HOST
  103. dnl Copied from the official gtk+-2 configure.in
  104. AC_MSG_CHECKING([for host platform])
  105. case "$host" in
  106. *-*-mingw*|*-*-cygwin*)
  107. platform_win32=yes
  108. LDFLAGS="$LDFLAGS -mwindows -Wl,--export-all-symbols"
  109. ;;
  110. *-apple-*)
  111. platform_osx=yes
  112. LDFLAGS="$LDFLAGS -Wl,-export_dynamic"
  113. ;;
  114. *)
  115. platform_win32=no
  116. platform_osx=no
  117. LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
  118. ;;
  119. esac
  120. AM_CONDITIONAL(PLATFORM_WIN32, test x"$platform_win32" = x"yes")
  121. AM_CONDITIONAL(PLATFORM_OSX, test x"$platform_osx" = x"yes")
  122. AC_MSG_RESULT([$host])
  123. AC_MSG_CHECKING([for native Win32])
  124. case "$host" in
  125. *-*-mingw*)
  126. os_win32=yes
  127. ;;
  128. *)
  129. os_win32=no
  130. ;;
  131. esac
  132. AC_MSG_RESULT([$os_win32])
  133. AM_CONDITIONAL(OS_WIN32, test x"$os_win32" = x"yes")
  134. AC_MSG_CHECKING([for Cygwin])
  135. case "$host" in
  136. *-*-cygwin*)
  137. env_cygwin=yes
  138. ;;
  139. *)
  140. env_cygwin=no
  141. ;;
  142. esac
  143. AC_MSG_RESULT([$env_cygwin])
  144. AM_CONDITIONAL(CYGWIN, test x"$env_cygwin" = x"yes")
  145. if test "$GCC" = "yes"
  146. then
  147. CFLAGS="$CFLAGS -Wno-unused-function"
  148. #CFLAGS="-g -Wall -Wno-unused-function"
  149. fi
  150. AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
  151. _gcc_cflags_save=$CFLAGS
  152. CFLAGS="-Wno-pointer-sign"
  153. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],_gcc_psign=yes,_gcc_psign=no)
  154. AC_MSG_RESULT($_gcc_psign)
  155. CFLAGS=$_gcc_cflags_save;
  156. if test x"$_gcc_psign" = xyes ; then
  157. CFLAGS="$CFLAGS -Wno-pointer-sign"
  158. fi
  159. CFLAGS="$CFLAGS -Wall -D_GNU_SOURCE"
  160. if test $USE_MAINTAINER_MODE = yes; then
  161. CFLAGS="$CFLAGS -g -Wno-pointer-sign -DUSE_MAINTAINER_MODE"
  162. fi
  163. pthread_name=
  164. case "$target" in
  165. *-darwin*)
  166. CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
  167. ;;
  168. *-*-mingw*)
  169. # Note that we need to link to pthread in all cases. This
  170. # is because some locking is used even when pthread support is
  171. # disabled.
  172. pthread_name=pthread
  173. CFLAGS="$CFLAGS -mms-bitfields"
  174. LIBS="$LIBS -l${pthread_name} -lws2_32 -lregex"
  175. ;;
  176. *-*-solaris*)
  177. CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
  178. CFLAGS="$CFLAGS -std=gnu99 -DSOLARIS"
  179. ;;
  180. esac
  181. dnl Checks for iconv
  182. AM_ICONV
  183. dnl floor and ceil are in -lm
  184. LIBS="$LIBS -lm"
  185. dnl
  186. dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
  187. dnl
  188. syl_save_LIBS=$LIBS
  189. LIBS="$LIBS $GTK_LIBS"
  190. AC_CHECK_FUNCS(bind_textdomain_codeset)
  191. LIBS=$syl_save_LIBS
  192. dnl for gettext
  193. ALL_LINGUAS="ca cs da de en_GB es fi fr hu id_ID it ja nb nl pl pt_BR ro ru sk sv tr zh_TW"
  194. GETTEXT_PACKAGE=claws-mail
  195. AC_SUBST(GETTEXT_PACKAGE)
  196. AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define text domain.])
  197. AM_GNU_GETTEXT_VERSION([0.18])
  198. AM_GNU_GETTEXT([external])
  199. AC_ARG_ENABLE(manual,
  200. [ --disable-manual Do not build user manual],
  201. [enable_manual=$enableval], [enable_manual=yes])
  202. AC_ARG_ENABLE(libsm,
  203. [ --disable-libsm Do not build libSM support for session management],
  204. [enable_libsm=$enableval], [enable_libsm=yes])
  205. AC_ARG_ENABLE(ipv6,
  206. [ --disable-ipv6 Do not build IPv6 support],
  207. [enable_ipv6=$enableval], [enable_ipv6=yes])
  208. AC_ARG_ENABLE(gnutls,
  209. [ --disable-gnutls Do not build GnuTLS support for SSL/TLS],
  210. [enable_gnutls=$enableval], [enable_gnutls=yes])
  211. AC_ARG_ENABLE(enchant,
  212. [ --disable-enchant Do not build Enchant support for spell-checking],
  213. [enable_enchant=$enableval], [enable_enchant=yes])
  214. AC_ARG_ENABLE(crash-dialog,
  215. [ --enable-crash-dialog Build crash dialog],
  216. [enable_crash_dialog=$enableval], [enable_crash_dialog=no])
  217. AC_ARG_ENABLE(generic-umpc,
  218. [ --enable-generic-umpc Build generic UMPC code],
  219. [enable_generic_umpc=$enableval], [enable_generic_umpc=no])
  220. AC_ARG_ENABLE(compface,
  221. [ --disable-compface Do not build compface support for X-Face],
  222. [enable_compface=$enableval], [enable_compface=yes])
  223. AC_ARG_ENABLE(pthread,
  224. [ --disable-pthread Do not build pthread support],
  225. [enable_pthread=$enableval], [enable_pthread=yes])
  226. AC_ARG_ENABLE(startup-notification,
  227. [ --disable-startup-notification Do not startup notification support],
  228. [enable_startup_notification=$enableval], [enable_startup_notification=yes])
  229. AC_ARG_ENABLE(dbus,
  230. [ --disable-dbus Do not build DBUS support],
  231. [enable_dbus=$enableval], [enable_dbus=yes])
  232. AC_ARG_ENABLE(ldap,
  233. [ --disable-ldap Do not build LDAP support],
  234. [enable_ldap=$enableval], [enable_ldap=yes])
  235. AC_ARG_ENABLE(jpilot,
  236. [ --disable-jpilot Do not build JPilot support],
  237. [enable_jpilot=$enableval], [enable_jpilot=yes])
  238. AC_ARG_ENABLE(networkmanager,
  239. [ --disable-networkmanager Do not build NetworkManager support],
  240. [enable_networkmanager=$enableval], [enable_networkmanager=yes])
  241. AC_ARG_ENABLE(libetpan,
  242. [ --disable-libetpan Do not build libetpan support for IMAP4/NNTP],
  243. [enable_libetpan=$enableval], [enable_libetpan=yes])
  244. AC_ARG_ENABLE(valgrind,
  245. [ --disable-valgrind Do not build valgrind support for debugging],
  246. [enable_valgrind=$enableval], [enable_valgrind=yes])
  247. AC_ARG_ENABLE(alternate-addressbook,
  248. [ --enable-alternate-addressbook Build alternate external address book support],
  249. [enable_alternate_addressbook=$enableval], [enable_alternate_addressbook=no])
  250. AC_ARG_ENABLE(svg,
  251. [ --disable-svg Do not build SVG support],
  252. [enable_svg=$enableval], [enable_svg=yes])
  253. AC_ARG_ENABLE(tests,
  254. [ --enable-tests Build unit tests],
  255. [enable_tests=$enableval], [enable_tests=no])
  256. manualdir='${docdir}/manual'
  257. AC_ARG_WITH(manualdir,
  258. [ --with-manualdir=DIR Manual directory],
  259. [manualdir="$withval"])
  260. AC_SUBST(manualdir)
  261. dnl ******************************
  262. dnl ** Check for required tools **
  263. dnl ** to build manuals **
  264. dnl ******************************
  265. AC_PATH_PROG(DOCBOOK2HTML, docbook2html)
  266. AC_PATH_PROG(DOCBOOK2TXT, docbook2txt)
  267. AC_PATH_PROG(DOCBOOK2PS, docbook2ps)
  268. AC_PATH_PROG(DOCBOOK2PDF, docbook2pdf)
  269. AM_CONDITIONAL(MANUAL_HTML, test -n "$DOCBOOK2HTML")
  270. AM_CONDITIONAL(MANUAL_TXT, test -n "$DOCBOOK2TXT")
  271. AM_CONDITIONAL(MANUAL_PDF, test -n "$DOCBOOK2PDF")
  272. AM_CONDITIONAL(MANUAL_PS, test -n "$DOCBOOK2PS")
  273. if test x"$enable_manual" = x"yes"; then
  274. if test -n "$DOCBOOK2TXT" -o -n "$DOCBOOK2HTML" \
  275. -o -n "$DOCBOOK2PS" -o -n "$DOCBOOK2PDF"; then
  276. enable_manual=yes
  277. else
  278. enable_manual=no
  279. fi
  280. fi
  281. AM_CONDITIONAL(BUILD_MANUAL, test x"$enable_manual" = xyes)
  282. dnl Set PACKAGE_DATA_DIR in config.h.
  283. if test "x${datarootdir}" = 'x${prefix}/share'; then
  284. if test "x${prefix}" = "xNONE"; then
  285. AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}",[PACKAGE_DATA_DIR])
  286. else
  287. AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}",[PACKAGE_DATA_DIR])
  288. fi
  289. else
  290. AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datarootdir}/${PACKAGE}",[PACKAGE_DATA_DIR])
  291. fi
  292. AC_CHECK_LIB(xpg4, setlocale)
  293. SM_LIBS=""
  294. dnl Check for LibSM
  295. AC_MSG_CHECKING([whether to use LibSM])
  296. if test x"$enable_libsm" = xyes; then
  297. AC_MSG_RESULT(yes)
  298. AC_CHECK_LIB(SM, SmcSaveYourselfDone,
  299. [SM_LIBS="$X_LIBS -lSM -lICE"],enable_libsm=no,
  300. $X_LIBS -lICE)
  301. AC_CHECK_HEADERS(X11/SM/SMlib.h,,enable_libsm=no)
  302. if test x"$enable_libsm" = xyes; then
  303. AC_DEFINE(HAVE_LIBSM, 1, [Define to 1 if you have libSM installed])
  304. else
  305. AC_MSG_RESULT(not found)
  306. AC_MSG_WARN([*** LibSM will not be supported ***])
  307. fi
  308. else
  309. AC_MSG_RESULT(no)
  310. fi
  311. AC_SUBST(SM_LIBS)
  312. dnl Check for d_type member in struct dirent
  313. AC_MSG_CHECKING([whether struct dirent has d_type member])
  314. AC_CACHE_VAL(ac_cv_dirent_d_type,[
  315. AC_TRY_COMPILE([#include <dirent.h>],
  316. [struct dirent d; d.d_type = DT_REG;],
  317. ac_cv_dirent_d_type=yes, ac_cv_dirent_d_type=no)
  318. ])
  319. AC_MSG_RESULT($ac_cv_dirent_d_type)
  320. if test $ac_cv_dirent_d_type = yes; then
  321. AC_DEFINE(HAVE_DIRENT_D_TYPE, 1,
  322. Define if `struct dirent' has `d_type' member.)
  323. fi
  324. # Check whether mkdir does not take the permission argument.
  325. GNUPG_FUNC_MKDIR_TAKES_ONE_ARG
  326. dnl Checks for header files.
  327. AC_HEADER_DIRENT
  328. AC_HEADER_STDC
  329. AC_HEADER_SYS_WAIT
  330. AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
  331. sys/param.h sys/utsname.h sys/select.h \
  332. wchar.h wctype.h locale.h netdb.h)
  333. AC_CHECK_HEADER([execinfo.h], [AC_DEFINE(HAVE_BACKTRACE,1,[Has backtrace*() needed for retrieving stack traces])])
  334. AC_SEARCH_LIBS(backtrace_symbols, [execinfo])
  335. dnl Checks for typedefs, structures, and compiler characteristics.
  336. AC_C_CONST
  337. AC_TYPE_OFF_T
  338. AC_TYPE_PID_T
  339. AC_TYPE_SIZE_T
  340. AC_STRUCT_TM
  341. dnl AC_CHECK_TYPE(wint_t, unsigned int) does not work because wint_t
  342. dnl may be defined only in wchar.h (this happens with gcc-2.96).
  343. dnl So we need to use this extended macro.
  344. CLAWS_CHECK_TYPE(wint_t, unsigned int,
  345. [
  346. #if HAVE_WCHAR_H
  347. #include <wchar.h>
  348. #endif
  349. ], Define to `unsigned int' if <stddef.h> or <wchar.h> doesn't define.)
  350. GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF, Used to test for a u32 typedef)
  351. AC_CHECK_SIZEOF(unsigned short, 2)
  352. AC_CHECK_SIZEOF(unsigned int, 4)
  353. AC_CHECK_SIZEOF(unsigned long, 4)
  354. dnl Checks for library functions.
  355. AC_FUNC_ALLOCA
  356. AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr strchr \
  357. uname flock lockf inet_aton inet_addr \
  358. fchmod mkstemp truncate getuid regcomp)
  359. AC_CHECK_FUNCS(fgets_unlocked fgetc_unlocked fputs_unlocked fputc_unlocked fread_unlocked fwrite_unlocked feof_unlocked ferror_unlocked fmemopen)
  360. dnl *****************
  361. dnl ** common code **
  362. dnl *****************
  363. dnl check for glib
  364. PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.28 gmodule-2.0 >= 2.28 gobject-2.0 >= 2.28 gthread-2.0 >= 2.28)
  365. GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
  366. AC_SUBST(GLIB_GENMARSHAL)
  367. AC_SUBST(GLIB_CFLAGS)
  368. AC_SUBST(GLIB_LIBS)
  369. dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
  370. syl_save_LIBS=$LIBS
  371. LIBS="$LIBS $GTK_LIBS"
  372. AC_CHECK_FUNCS(bind_textdomain_codeset)
  373. LIBS=$syl_save_LIBS
  374. dnl check for IPv6 option
  375. dnl automated checks for IPv6 support.
  376. AC_MSG_CHECKING([whether to use IPv6])
  377. if test x"$enable_ipv6" = xyes; then
  378. AC_MSG_RESULT(yes)
  379. AC_MSG_CHECKING([for IPv6 support])
  380. if test x"$platform_win32" = xyes; then
  381. AC_CACHE_VAL(ac_cv_ipv6,[
  382. AC_TRY_COMPILE([
  383. #include <ws2tcpip.h>
  384. ], [struct in6_addr a;],
  385. ac_cv_ipv6=yes, ac_cv_ipv6=no)
  386. ])
  387. else
  388. AC_CACHE_VAL(ac_cv_ipv6,[
  389. AC_TRY_COMPILE([
  390. #define INET6
  391. #include <sys/types.h>
  392. #include <netinet/in.h>
  393. ], [int x = IPPROTO_IPV6; struct in6_addr a;],
  394. ac_cv_ipv6=yes, ac_cv_ipv6=no)
  395. ])
  396. fi
  397. AC_MSG_RESULT($ac_cv_ipv6)
  398. if test $ac_cv_ipv6 = yes; then
  399. AC_DEFINE(INET6, 1, Define if you want IPv6 support.)
  400. else
  401. AC_MSG_WARN(*** IPv6 will not be supported ***)
  402. enable_ipv6=no
  403. fi
  404. else
  405. AC_MSG_RESULT(no)
  406. fi
  407. dnl GNUTLS
  408. AC_MSG_CHECKING([whether to use GnuTLS])
  409. AC_MSG_RESULT($enable_gnutls)
  410. if test "x$enable_gnutls" != "xno"; then
  411. PKG_CHECK_MODULES(GNUTLS, gnutls >= 2.2,
  412. [
  413. AC_DEFINE(USE_GNUTLS, 1, gnutls)
  414. echo "Building with GnuTLS"
  415. PKG_CHECK_MODULES(GNUTLS, gnutls >= 2.11,
  416. [
  417. dnl No linking against libgcrypt needed
  418. ],
  419. [
  420. dnl linking against libgcrypt *is* needed
  421. GNUTLS_LIBS="$GNUTLS_LIBS -lgcrypt"
  422. ])
  423. ],
  424. [
  425. echo "Building without GnuTLS"
  426. AC_MSG_RESULT([*** GnuTLS support is recommended ])
  427. AC_MSG_RESULT([*** You can use --disable-gnutls if you don't need it.])
  428. AC_MSG_ERROR([GnuTLS not found])
  429. ])
  430. AC_SUBST(GNUTLS_LIBS)
  431. AC_SUBST(GNUTLS_CFLAGS)
  432. fi
  433. PKG_CHECK_MODULES(NETTLE, nettle)
  434. AC_SUBST(NETTLE_LIBS)
  435. AC_ARG_WITH(passcrypt-key, [ --with-passcrypt-key=KEY Key used to encode passwords (8 byte string)],
  436. with_passcrypt_key="$withval", with_passcrypt_key="passkey0")
  437. AC_SUBST(PASSCRYPT_KEY, $with_passcrypt_key)
  438. dnl RC dir (will be default at a certain point in time)
  439. AC_ARG_WITH(config-dir, [ --with-config-dir=RCDIR Local configuration dir (default: .claws-mail)],
  440. ac_cv_with_config_dir="$withval", ac_cv_with_config_dir="")
  441. dnl Set correct default value based on platform
  442. if test x"$ac_cv_with_config_dir" = x""; then
  443. if test x"$platform_win32" = xyes; then
  444. ac_cv_with_config_dir="Claws-mail"
  445. else
  446. ac_cv_with_config_dir=".claws-mail"
  447. fi
  448. fi
  449. AC_DEFINE_UNQUOTED(CFG_RC_DIR, "$ac_cv_with_config_dir", Configuration directory)
  450. AC_ARG_WITH(password-encryption, [ --with-password-encryption=PROVIDER Which cryptographic library to use for encrypting stored passwords (gnutls, old, default)],
  451. pwd_crypto="$withval", pwd_crypto="default")
  452. if test x"$pwd_crypto" = xdefault; then
  453. if test x"$enable_gnutls" = xyes; then
  454. if `$PKG_CONFIG --atleast-version=3.0 gnutls`; then
  455. pwd_crypto="gnutls"
  456. fi
  457. fi
  458. fi
  459. if test x"$pwd_crypto" = xdefault; then
  460. pwd_crypto="old"
  461. fi
  462. case $pwd_crypto in
  463. gnutls)
  464. if test x"$enable_gnutls" = xno; then
  465. AC_MSG_ERROR([GnuTLS password encryption requested but GnuTLS is not available.])
  466. fi
  467. if ! `$PKG_CONFIG --atleast-version=3.0 gnutls`; then
  468. AC_MSG_ERROR([GnuTLS version at least 3.0 is required for password encryption.])
  469. fi
  470. AC_DEFINE(PASSWORD_CRYPTO_GNUTLS, 1, Use GnuTLS for stored password encryption)
  471. ;;
  472. old)
  473. AC_DEFINE(PASSWORD_CRYPTO_OLD, 1, Use old insecure method for stored password encryption)
  474. ;;
  475. *)
  476. AC_MSG_ERROR([Unknown password encryption provider requested.])
  477. ;;
  478. esac
  479. dnl ************************
  480. dnl ** GTK user interface **
  481. dnl ************************
  482. dnl Checks for GTK
  483. PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 3.20 cairo)
  484. AC_ARG_ENABLE(deprecated,
  485. [ --disable-deprecated Disable deprecated GTK functions],
  486. [GTK_CFLAGS="$GTK_CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"], [])
  487. dnl Make sure the code does not regress to using deprecated GTK stuff...
  488. GTK_CFLAGS="$GTK_CFLAGS -DGTK_DISABLE_SINGLE_INCLUDES -DGSEAL_ENABLE"
  489. AC_SUBST(GTK_CFLAGS)
  490. AC_SUBST(GTK_LIBS)
  491. dnl enchant is used for spell checking
  492. AC_MSG_CHECKING([whether to use enchant])
  493. AC_MSG_RESULT($enable_enchant)
  494. if test $enable_enchant = yes; then
  495. PKG_CHECK_MODULES(ENCHANT, enchant >= 1.4.0,
  496. [
  497. AC_DEFINE(USE_ENCHANT, 1, enchant)
  498. echo "Building with enchant"
  499. enable_enchant=yes
  500. ],
  501. [
  502. PKG_CHECK_MODULES(ENCHANT, enchant-2 >= 2.0.0,
  503. [
  504. AC_DEFINE(USE_ENCHANT, 1, enchant-2)
  505. echo "Building with enchant-2"
  506. enable_enchant=yes
  507. ],
  508. [
  509. echo "Building without enchant-notification"
  510. enable_enchant=no
  511. ])
  512. ])
  513. AC_SUBST(ENCHANT_CFLAGS)
  514. AC_SUBST(ENCHANT_LIBS)
  515. fi
  516. dnl want crash dialog
  517. if test $enable_crash_dialog = yes; then
  518. dnl check if GDB is somewhere
  519. AC_CHECK_PROG(enable_crash_dialog, gdb, yes, no)
  520. AC_MSG_CHECKING([whether to use crash dialog])
  521. if test $enable_crash_dialog = yes; then
  522. AC_DEFINE(CRASH_DIALOG, 1, Pop up crash dialog)
  523. fi
  524. AC_MSG_RESULT($enable_crash_dialog)
  525. fi
  526. dnl generic umpc
  527. if test $enable_generic_umpc = yes; then
  528. AC_DEFINE(GENERIC_UMPC, 1, Generic UMPC code)
  529. AC_MSG_RESULT($enable_generic_umpc)
  530. fi
  531. dnl Check for X-Face support
  532. AC_MSG_CHECKING([whether to use compface])
  533. if test x"$enable_compface" = xyes; then
  534. AC_MSG_RESULT(yes)
  535. AC_CHECK_LIB(compface, uncompface,
  536. [AC_DEFINE(HAVE_LIBCOMPFACE, 1, Define if you want compface support.)],
  537. [enable_compface=no])
  538. if test x"$enable_compface" = xyes; then
  539. COMPFACE_LIBS="-lcompface"
  540. else
  541. COMPFACE_LIBS=""
  542. fi
  543. AC_SUBST(COMPFACE_LIBS)
  544. else
  545. AC_MSG_RESULT(no)
  546. fi
  547. dnl check for pthread support
  548. AC_MSG_CHECKING([whether to use pthread])
  549. if test x$enable_pthread = xno; then
  550. AC_MSG_RESULT(no)
  551. else
  552. AC_MSG_RESULT(yes)
  553. # For W32 we need to use a special ptrhead lib. In this case we can't
  554. # use AC_CHECK_LIB because it has no means of checking for a
  555. # library installed under a different name. Checking for the
  556. # header is okay.
  557. if test -n "${pthread_name}" ; then
  558. enable_pthread=yes
  559. else
  560. AC_CHECK_LIB(pthread, pthread_create, :, enable_pthread=no)
  561. fi
  562. AC_CHECK_HEADERS(pthread.h, :, enable_pthread=no)
  563. if test x$enable_pthread = xyes; then
  564. AC_DEFINE(USE_PTHREAD, 1, Define if you have pthread)
  565. if test -z "${pthread_name}" ; then
  566. PTHREAD_LIBS="-lpthread"
  567. fi
  568. fi
  569. fi
  570. AC_SUBST(PTHREAD_LIBS)
  571. dnl
  572. dnl Check whether we need to pass -lresolv
  573. dnl We know that we don't need it for W32.
  574. dnl
  575. if test x$os_win32 = xno; then
  576. t_oldLibs="$LIBS"
  577. LIBS="$LIBS"
  578. ac_cv_var__res_options=no
  579. AC_TRY_LINK([#include <sys/types.h>
  580. #include <sys/socket.h>
  581. #include <netinet/in.h>
  582. #include <arpa/nameser.h>
  583. #include <resolv.h>],
  584. [_res.options = RES_INIT;],
  585. ac_cv_var__res_options=yes);
  586. if test "$ac_cv_var__res_options" != "yes"; then
  587. LIBRESOLV="-lresolv"
  588. fi
  589. LIBS="$t_oldLibs"
  590. if test "x$LIBRESOLV" = "x"; then
  591. AC_CHECK_LIB(resolv, res_query, [LIBRESOLV=-lresolv])
  592. LIBS="$t_oldLibs"
  593. fi
  594. fi
  595. AC_SUBST(LIBRESOLV)
  596. LIBS="$LIBS $LIBRESOLV"
  597. dnl #######################################################################
  598. dnl # Check for startup notification
  599. dnl #######################################################################
  600. if test "x$enable_startup_notification" = "xyes"; then
  601. PKG_CHECK_MODULES(STARTUP_NOTIFICATION, libstartup-notification-1.0 >= 0.5,
  602. [
  603. AC_DEFINE(HAVE_STARTUP_NOTIFICATION, 1, [Define if we're using libstartup-notification.])
  604. echo "Building with libstartup-notification"
  605. enable_startup_notification=yes
  606. ],
  607. [
  608. echo "Building without libstartup-notification"
  609. enable_startup_notification=no
  610. ])
  611. AC_SUBST(STARTUP_NOTIFICATION_CFLAGS)
  612. AC_SUBST(STARTUP_NOTIFICATION_LIBS)
  613. fi
  614. dnl #######################################################################
  615. dnl # Check for D-Bus support
  616. dnl #######################################################################
  617. if test "x$enable_dbus" = "xyes"; then
  618. PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.60, dbus-glib-1 >= 0.60],
  619. [
  620. AC_DEFINE(HAVE_DBUS_GLIB, 1, [Define if glib bindings of D-Bus are available])
  621. enable_dbus=yes
  622. ],
  623. [
  624. echo "D-Bus requirements not met. D-Bus support not activated."
  625. enable_dbus=no
  626. ])
  627. AC_SUBST(DBUS_CFLAGS)
  628. AC_SUBST(DBUS_LIBS)
  629. fi
  630. dnl #######################################################################
  631. dnl # Configure address book support
  632. dnl #######################################################################
  633. dnl #######################################################################
  634. dnl # Check for alternate address book support
  635. dnl #######################################################################
  636. AC_MSG_CHECKING([whether DBUS support for alternate address book is present])
  637. if test x"$enable_dbus" = xyes; then
  638. AC_MSG_RESULT([yes])
  639. AC_MSG_CHECKING([whether to enable alternate address book])
  640. if test x"$enable_alternate_addressbook" = xyes; then
  641. AC_MSG_RESULT([yes])
  642. PKG_CHECK_MODULES(CONTACTS, [claws-contacts],
  643. [
  644. AC_DEFINE(USE_ALT_ADDRBOOK, 1, [Define if alternate address book is to be activated.])
  645. enable_alternate_addressbook=yes
  646. AC_SUBST(CONTACTS_CFLAGS)
  647. AC_SUBST(CONTACTS_LIBS)
  648. ],
  649. [
  650. enable_alternate_addressbook=no
  651. ])
  652. else
  653. AC_MSG_RESULT([no])
  654. enable_alternate_addressbook=no
  655. fi
  656. else
  657. AC_MSG_RESULT([no])
  658. enable_alternate_addressbook=no
  659. fi
  660. dnl #######################################################################
  661. dnl # Check for old address book support
  662. dnl #######################################################################
  663. if test x"$enable_alternate_addressbook" = xno; then
  664. dnl for LDAP support in addressbook
  665. dnl no check for libraries; dynamically loaded
  666. AC_MSG_CHECKING([whether to use LDAP])
  667. if test x"$enable_ldap" = xno; then
  668. AC_MSG_RESULT(no)
  669. elif test x"$enable_ldap" = xyes -a x"$enable_pthread" = xno; then
  670. AC_MSG_RESULT(no - LDAP support needs pthread support)
  671. enable_ldap=no
  672. elif test x"$platform_win32" = xyes; then
  673. AC_MSG_RESULT(yes)
  674. AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
  675. LDAP_LIBS="-lwldap32"
  676. AC_SUBST(LDAP_LIBS)
  677. else
  678. AC_MSG_RESULT(yes)
  679. dnl check for available libraries, and pull them in
  680. AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="$LDAP_LIBS -lresolv")
  681. AC_CHECK_LIB(socket, bind, LDAP_LIBS="$LDAP_LIBS -lsocket")
  682. AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl")
  683. AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS="$LDAP_LIBS -llber",,
  684. $LDAP_LIBS)
  685. AC_CHECK_HEADERS(ldap.h lber.h,
  686. [ enable_ldap=yes ],
  687. [ enable_ldap=no ])
  688. if test "$enable_ldap" = yes; then
  689. AC_CHECK_LIB(ldap, ldap_open,
  690. [ enable_ldap=yes ],
  691. [ enable_ldap=no ],
  692. $LDAP_LIBS)
  693. AC_CHECK_LIB(ldap, ldap_start_tls_s,
  694. [ ac_cv_have_tls=yes ],
  695. [ ac_cv_have_tls=no ])
  696. fi
  697. AC_MSG_CHECKING([whether ldap library is available])
  698. AC_MSG_RESULT($enable_ldap)
  699. AC_MSG_CHECKING([whether TLS library is available])
  700. AC_MSG_RESULT($ac_cv_have_tls)
  701. if test "$enable_ldap" = yes; then
  702. AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
  703. LDAP_LIBS="$LDAP_LIBS -lldap"
  704. AC_SUBST(LDAP_LIBS)
  705. if test "$ac_cv_have_tls" = yes; then
  706. AC_DEFINE(USE_LDAP_TLS, 1, Define if you want LDAP TLS support in addressbook.)
  707. fi
  708. dnl As of OpenLDAP API version 3000 a number of functions has
  709. dnl been deprecated. As Claws-mail compiles and runs on many
  710. dnl platforms and many versions of OpenLDAP we need to be able
  711. dnl to switch between the old and new API because new API has
  712. dnl added new functions replacing old ones and at the same time
  713. dnl old functions has been changed.
  714. dnl If cross-compiling defaults to enable deprecated features
  715. dnl for maximum portability
  716. AC_MSG_CHECKING([The API version of OpenLDAP])
  717. AC_RUN_IFELSE(
  718. [AC_LANG_PROGRAM(
  719. [#include <ldap.h>],
  720. [if (LDAP_API_VERSION >= 3000)
  721. return 1
  722. ])],
  723. [AC_MSG_RESULT([version < 3000])
  724. AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 0, Define if OpenLDAP API is at least version 3000.)],
  725. [AC_MSG_RESULT([version >= 3000])
  726. AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 1, Define if OpenLDAP API is at least version 3000.)],
  727. [AC_MSG_RESULT([Enabling deprecated features in OpenLDAP])
  728. AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 0, Define if OpenLDAP API is at least version 3000.)
  729. AC_DEFINE(LDAP_DEPRECATED, 1, Define to activate deprecated features in OpenLDAP)]
  730. )
  731. fi
  732. fi
  733. dnl for JPilot support in addressbook
  734. dnl no check for libraries; these are dynamically loaded
  735. AC_MSG_CHECKING([whether to use JPilot])
  736. if test "$enable_jpilot" = yes; then
  737. AC_MSG_RESULT(yes)
  738. AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h pi-version.h,
  739. [ AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ],
  740. [ enable_jpilot=no ])
  741. if test "$enable_jpilot" = no; then
  742. AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h libpisock/pi-version.h,
  743. [ enable_jpilot=yes
  744. AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ])
  745. fi
  746. AC_CHECK_LIB(pisock, unpack_Address, [JPILOT_LIBS="-lpisock"], [JPILOT_LIBS="" enable_jpilot="no"])
  747. if test x"$enable_jpilot" = xyes; then
  748. AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.)
  749. else
  750. AC_MSG_NOTICE([JPilot support not available])
  751. fi
  752. AC_SUBST(JPILOT_LIBS)
  753. else
  754. AC_MSG_RESULT(no)
  755. fi
  756. fi
  757. AM_CONDITIONAL(BUILD_ALTADDRBOOK, test x"$enable_alternate_addressbook" = x"yes")
  758. dnl #######################################################################
  759. dnl # Check for NetworkManager support
  760. dnl #######################################################################
  761. if test x"$enable_dbus" = xyes; then
  762. if test x"$enable_networkmanager" = xyes; then
  763. PKG_CHECK_MODULES(NETWORKMANAGER_SUPPORT, libnm,
  764. [
  765. AC_DEFINE(HAVE_NETWORKMANAGER_SUPPORT, 1, [Define if NetworkManager support is to be included.])
  766. echo "Building with NetworkManager support"
  767. enable_networkmanager=yes
  768. ],
  769. [
  770. echo "NetworkManager not found."
  771. enable_networkmanager=no
  772. ])
  773. AC_SUBST(NETWORKMANAGER_SUPPORT_CFLAGS)
  774. fi
  775. else
  776. echo "NetworkManager support deactivated as D-Bus requirements were not met."
  777. enable_networkmanager=no
  778. fi
  779. dnl Libetpan
  780. AC_MSG_CHECKING([whether to use libetpan])
  781. if test x"$enable_libetpan" = xyes; then
  782. AC_MSG_RESULT(yes)
  783. libetpan_result=no
  784. AC_PATH_PROG(libetpanconfig, [libetpan-config])
  785. if test "x$libetpanconfig" != "x"; then
  786. CPPFLAGS="$CPPFLAGS `$libetpanconfig --cflags 2>/dev/null`"
  787. AC_CHECK_HEADER(libetpan/libetpan.h, [libetpan_result=yes])
  788. if test "x$libetpan_result" = "xyes"; then
  789. AC_MSG_CHECKING([whether libetpan-config hints compiles and links fine])
  790. LIBS="$LIBS `$libetpanconfig --libs 2>/dev/null`"
  791. AC_TRY_LINK([#include <libetpan/dbstorage.h>], [db_mailstorage_init(NULL, NULL);], [libetpan_result=yes], [libetpan_result=no])
  792. AC_MSG_RESULT([$libetpan_result])
  793. fi
  794. fi
  795. if test "x$libetpan_result" = "xyes"; then
  796. LIBETPAN_CPPFLAGS="`$libetpanconfig --cflags`"
  797. LIBETPAN_LIBS="`$libetpanconfig --libs`"
  798. LIBETPAN_VERSION=`$libetpanconfig --version | $AWK -F. '{printf "%d", ($1 * 100) + $2}'`
  799. if test "$LIBETPAN_VERSION" -lt "57"; then
  800. AC_MSG_RESULT([*** Claws Mail requires libetpan 0.57 or newer. See http://www.etpan.org/])
  801. AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 and/or NNTP support.])
  802. AC_MSG_ERROR([libetpan 0.57 not found])
  803. fi
  804. AC_SUBST(LIBETPAN_FLAGS)
  805. AC_SUBST(LIBETPAN_LIBS)
  806. AC_DEFINE(HAVE_LIBETPAN, 1, Define if you want IMAP and/or NNTP support.)
  807. else
  808. AC_MSG_RESULT([*** Claws Mail requires libetpan 0.57 or newer. See http://www.etpan.org/ ])
  809. AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 and/or NNTP support.])
  810. AC_MSG_ERROR([libetpan 0.57 not found])
  811. fi
  812. else
  813. AC_MSG_RESULT(no)
  814. fi
  815. AM_CONDITIONAL(CLAWS_LIBETPAN, test "x$libetpan_result" = "xyes")
  816. dnl librsvg
  817. AC_MSG_CHECKING([whether to use librsvg])
  818. if test x"$enable_svg" = xyes; then
  819. AC_MSG_RESULT(yes)
  820. PKG_CHECK_MODULES([SVG], [librsvg-2.0 >= 2.39.0 cairo >= 1.0.0],
  821. [
  822. AC_SUBST(SVG_CFLAGS)
  823. AC_SUBST(SVG_LIBS)
  824. AC_DEFINE(HAVE_SVG, 1, [Define if librsvg2 is available for SVG support])
  825. enable_svg=yes
  826. ],
  827. [
  828. AC_MSG_NOTICE([SVG support deactivated as librsvg2 >= 2.39.0 was not found])
  829. enable_svg=no
  830. ])
  831. else
  832. AC_MSG_RESULT(no)
  833. fi
  834. AC_MSG_CHECKING([whether to use valgrind])
  835. if test x$enable_valgrind = xyes; then
  836. AC_MSG_RESULT(yes)
  837. PKG_CHECK_MODULES(VALGRIND, valgrind >= 2.4.0,
  838. enable_valgrind=yes, enable_valgrind=no)
  839. if test x"$enable_valgrind" = xyes; then
  840. AC_DEFINE(HAVE_VALGRIND, 1, Define if you want valgrind support)
  841. else
  842. AC_MSG_RESULT(not found)
  843. fi
  844. else
  845. AC_MSG_RESULT(no)
  846. fi
  847. AM_CONDITIONAL(CLAWS_VALGRIND, test x"$enable_valgrind" = x"yes")
  848. AC_MSG_CHECKING([whether to build unit tests])
  849. if test x$enable_tests = xyes; then
  850. AC_MSG_RESULT(yes)
  851. else
  852. AC_MSG_RESULT(no)
  853. fi
  854. AM_CONDITIONAL(BUILD_TESTS, test "x$enable_tests" = "xyes")
  855. dnl *************************
  856. dnl ** section for plugins **
  857. dnl *************************
  858. PLUGINS=""
  859. DISABLED_PLUGINS=""
  860. MISSING_DEPS_PLUGINS=""
  861. dnl First we set the enabled status - either enabled (yes), auto-enabled (auto)
  862. dnl or (auto-)disabled (no for both)
  863. dnl
  864. dnl All plugins are auto-enabled except for Demo which is just there to help
  865. dnl potential plugins writers.
  866. AC_ARG_ENABLE(acpi_notifier-plugin,
  867. [ --disable-acpi_notifier-plugin Do not build acpi_notifier plugin],
  868. [enable_acpi_notifier_plugin=$enableval], [enable_acpi_notifier_plugin=auto])
  869. AC_ARG_ENABLE(address_keeper-plugin,
  870. [ --disable-address_keeper-plugin Do not build address_keeper plugin],
  871. [enable_address_keeper_plugin=$enableval], [enable_address_keeper_plugin=auto])
  872. AC_ARG_ENABLE(archive-plugin,
  873. [ --disable-archive-plugin Do not build archive plugin],
  874. [enable_archive_plugin=$enableval], [enable_archive_plugin=auto])
  875. AC_ARG_ENABLE(att_remover-plugin,
  876. [ --disable-att_remover-plugin Do not build att_remover plugin],
  877. [enable_att_remover_plugin=$enableval], [enable_att_remover_plugin=auto])
  878. AC_ARG_ENABLE(attachwarner-plugin,
  879. [ --disable-attachwarner-plugin Do not build attachwarner plugin],
  880. [enable_attachwarner_plugin=$enableval], [enable_attachwarner_plugin=auto])
  881. AC_ARG_ENABLE(bogofilter-plugin,
  882. [ --disable-bogofilter-plugin Do not build bogofilter plugin],
  883. [enable_bogofilter_plugin=$enableval], [enable_bogofilter_plugin=auto])
  884. AC_ARG_ENABLE(bsfilter-plugin,
  885. [ --disable-bsfilter-plugin Do not build bsfilter plugin],
  886. [enable_bsfilter_plugin=$enableval], [enable_bsfilter_plugin=auto])
  887. AC_ARG_ENABLE(clamd-plugin,
  888. [ --disable-clamd-plugin Do not build clamd plugin],
  889. [enable_clamd_plugin=$enableval], [enable_clamd_plugin=auto])
  890. AC_ARG_ENABLE(dillo-plugin,
  891. [ --disable-dillo-plugin Do not build dillo plugin],
  892. [enable_dillo_plugin=$enableval], [enable_dillo_plugin=auto])
  893. AC_ARG_ENABLE(fancy-plugin,
  894. [ --disable-fancy-plugin Do not build fancy plugin],
  895. [enable_fancy_plugin=$enableval], [enable_fancy_plugin=auto])
  896. AC_ARG_ENABLE(fetchinfo-plugin,
  897. [ --disable-fetchinfo-plugin Do not build fetchinfo plugin],
  898. [enable_fetchinfo_plugin=$enableval], [enable_fetchinfo_plugin=auto])
  899. AC_ARG_ENABLE(gdata-plugin,
  900. [ --disable-gdata-plugin Do not build gdata plugin],
  901. [enable_gdata_plugin=$enableval], [enable_gdata_plugin=auto])
  902. AC_ARG_ENABLE(libravatar-plugin,
  903. [ --disable-libravatar-plugin Do not build libravatar plugin],
  904. [enable_libravatar_plugin=$enableval], [enable_libravatar_plugin=auto])
  905. AC_ARG_ENABLE(mailmbox-plugin,
  906. [ --disable-mailmbox-plugin Do not build mailmbox plugin],
  907. [enable_mailmbox_plugin=$enableval], [enable_mailmbox_plugin=auto])
  908. AC_ARG_ENABLE(managesieve-plugin,
  909. [ --disable-managesieve-plugin Do not build managesieve plugin],
  910. [enable_managesieve_plugin=$enableval], [enable_managesieve_plugin=auto])
  911. AC_ARG_ENABLE(newmail-plugin,
  912. [ --disable-newmail-plugin Do not build newmail plugin],
  913. [enable_newmail_plugin=$enableval], [enable_newmail_plugin=auto])
  914. AC_ARG_ENABLE(notification-plugin,
  915. [ --disable-notification-plugin Do not build notification plugin],
  916. [enable_notification_plugin=$enableval], [enable_notification_plugin=auto])
  917. AC_ARG_ENABLE(pdf_viewer-plugin,
  918. [ --disable-pdf_viewer-plugin Do not build pdf_viewer plugin],
  919. [enable_pdf_viewer_plugin=$enableval], [enable_pdf_viewer_plugin=auto])
  920. AC_ARG_ENABLE(perl-plugin,
  921. [ --disable-perl-plugin Do not build perl plugin],
  922. [enable_perl_plugin=$enableval], [enable_perl_plugin=auto])
  923. AC_ARG_ENABLE(python-plugin,
  924. [ --disable-python-plugin Do not build python plugin],
  925. [enable_python_plugin=$enableval], [enable_python_plugin=auto])
  926. AC_ARG_ENABLE(pgpcore-plugin,
  927. [ --disable-pgpcore-plugin Do not build pgpcore plugin],
  928. [enable_pgpcore_plugin=$enableval], [enable_pgpcore_plugin=auto])
  929. AC_ARG_ENABLE(pgpmime-plugin,
  930. [ --disable-pgpmime-plugin Do not build pgpmime plugin],
  931. [enable_pgpmime_plugin=$enableval], [enable_pgpmime_plugin=auto])
  932. AC_ARG_ENABLE(pgpinline-plugin,
  933. [ --disable-pgpinline-plugin Do not build pgpinline plugin],
  934. [enable_pgpinline_plugin=$enableval], [enable_pgpinline_plugin=auto])
  935. AC_ARG_ENABLE(rssyl-plugin,
  936. [ --disable-rssyl-plugin Do not build rssyl plugin],
  937. [enable_rssyl_plugin=$enableval], [enable_rssyl_plugin=auto])
  938. AC_ARG_ENABLE(smime-plugin,
  939. [ --disable-smime-plugin Do not build smime plugin],
  940. [enable_smime_plugin=$enableval], [enable_smime_plugin=auto])
  941. AC_ARG_ENABLE(spamassassin-plugin,
  942. [ --disable-spamassassin-plugin Do not build spamassassin plugin],
  943. [enable_spamassassin_plugin=$enableval], [enable_spamassassin_plugin=auto])
  944. AC_ARG_ENABLE(spam_report-plugin,
  945. [ --disable-spam_report-plugin Do not build spam_report plugin],
  946. [enable_spam_report_plugin=$enableval], [enable_spam_report_plugin=auto])
  947. AC_ARG_ENABLE(tnef_parse-plugin,
  948. [ --disable-tnef_parse-plugin Do not build tnef_parse plugin],
  949. [enable_tnef_parse_plugin=$enableval], [enable_tnef_parse_plugin=auto])
  950. AC_ARG_ENABLE(vcalendar-plugin,
  951. [ --disable-vcalendar-plugin Do not build vcalendar plugin],
  952. [enable_vcalendar_plugin=$enableval], [enable_vcalendar_plugin=auto])
  953. dnl disabled by default
  954. AC_ARG_ENABLE(demo-plugin,
  955. [ --enable-demo-plugin Build demo plugin],
  956. [enable_demo_plugin=$enableval], [enable_demo_plugin=no])
  957. dnl Then we check (unconditionnaly) for plugins dependencies
  958. dnl Some dependencies are optional, some mandatory. This is taken care of
  959. dnl later.
  960. dnl
  961. dnl During this dependancy check we do the checks themselves, define HAVE_X to
  962. dnl either yes or no, and do the AC_SUBST calls.
  963. dnl Archive: libarchive
  964. dnl Fancy: Webkit, curl, optionally libsoup-gnome
  965. dnl Gdata: libgdata
  966. dnl Libravatar: libcurl
  967. dnl Notification: optionally libnotify unity/messaging-menu
  968. dnl libcanberra_gtk hotkey
  969. dnl Pdf-Viewer: libpoppler
  970. dnl Perl: sed perl
  971. dnl PGP/Core: libgpgme
  972. dnl PGP/Mime: pgpcore libgpgme
  973. dnl PGP/Inline: pgpcore libgpgme
  974. dnl S/Mime: pgpcore libgpgme
  975. dnl Python: Python
  976. dnl RSSyl: expat libcurl
  977. dnl SpamReport: libcurl
  978. dnl vCalendar: libcurl, libical
  979. dnl tnef_parse: libytnef
  980. dnl libcurl ********************************************************************
  981. PKG_CHECK_MODULES(CURL, libcurl, HAVE_CURL=yes, HAVE_CURL=no)
  982. AC_SUBST(CURL_LIBS)
  983. AC_SUBST(CURL_CFLAGS)
  984. dnl expat **********************************************************************
  985. PKG_CHECK_MODULES(EXPAT, expat, HAVE_EXPAT=yes, HAVE_EXPAT=no)
  986. if test x"$HAVE_EXPAT" = xno; then
  987. AC_CHECK_HEADER(expat.h, [expat_header=yes], [expat_header=no])
  988. AC_CHECK_LIB(expat, XML_ParserCreate, [expat_lib=yes], [expat_lib=no])
  989. if test x"$expat_header" = xyes -a x"$expat_lib"=xyes; then
  990. HAVE_EXPAT=yes
  991. EXPAT_CFLAGS=""
  992. EXPAT_LIBS="-lexpat"
  993. fi
  994. fi
  995. AC_SUBST(EXPAT_CFLAGS)
  996. AC_SUBST(EXPAT_LIBS)
  997. dnl webkit *********************************************************************
  998. PKG_CHECK_MODULES(WEBKIT, webkit2gtk-4.0 >= 2.18.0, HAVE_WEBKIT=yes, HAVE_WEBKIT=no)
  999. AC_SUBST(WEBKIT_LIBS)
  1000. AC_SUBST(WEBKIT_CFLAGS)
  1001. dnl libsoup ********************************************************************
  1002. PKG_CHECK_MODULES(LIBSOUP, libsoup-2.4, HAVE_LIBSOUP=yes, HAVE_LIBSOUP=no)
  1003. if test x"$HAVE_LIBSOUP" = xyes; then
  1004. AC_DEFINE(HAVE_LIBSOUP, 1, [Define if libsoup is available])
  1005. fi
  1006. AC_SUBST(LIBSOUP_CFLAGS)
  1007. AC_SUBST(LIBSOUP_LIBS)
  1008. dnl libsoup-gnome **************************************************************
  1009. PKG_CHECK_MODULES(LIBSOUP_GNOME, libsoup-gnome-2.4 >= 2.26, HAVE_LIBSOUP_GNOME=yes, HAVE_LIBSOUP_GNOME=no)
  1010. if test x"$HAVE_LIBSOUP_GNOME" = xyes; then
  1011. AC_DEFINE(HAVE_LIBSOUP_GNOME, 1, [Define if libsoup_gnome is available])
  1012. fi
  1013. AC_SUBST(LIBSOUP_GNOME_CFLAGS)
  1014. AC_SUBST(LIBSOUP_GNOME_LIBS)
  1015. dnl libarchive *****************************************************************
  1016. PKG_CHECK_MODULES(LIBARCHIVE, libarchive, HAVE_ARCHIVE=yes, HAVE_ARCHIVE=no)
  1017. AC_SUBST(ARCHIVE_LIBS)
  1018. AC_SUBST(ARCHIVE_CFLAGS)
  1019. AC_CHECK_LIB([archive], [archive_read_new],
  1020. ARCHIVE_LIBS=-larchive
  1021. HAVE_ARCHIVE=yes
  1022. AC_SUBST(ARCHIVE_LIBS,$ARCHIVE_CFLAGS),
  1023. HAVE_ARCHIVE=no
  1024. )
  1025. dnl libgdata *******************************************************************
  1026. PKG_CHECK_MODULES(GDATA, libgdata >= 0.17.2, HAVE_GDATA=yes, HAVE_GDATA=no)
  1027. AC_SUBST(GDATA_CFLAGS)
  1028. AC_SUBST(GDATA_LIBS)
  1029. dnl libical ********************************************************************
  1030. PKG_CHECK_MODULES(LIBICAL, libical >= 2.0, HAVE_LIBICAL=yes, HAVE_LIBICAL=no)
  1031. AC_SUBST(LIBICAL_CFLAGS)
  1032. AC_SUBST(LIBICAL_LIBS)
  1033. dnl Poppler ********************************************************************
  1034. PKG_CHECK_MODULES(POPPLER, poppler-glib >= 0.12.0, HAVE_POPPLER=yes, HAVE_POPPLER=no)
  1035. AC_SUBST(POPPLER_LIBS)
  1036. AC_SUBST(POPPLER_CFLAGS)
  1037. dnl check for Poppler extra features that we conditionally support
  1038. if test x"$HAVE_POPPLER" = xyes; then
  1039. OLD_CFLAGS=$CFLAGS
  1040. CFLAGS="$POPPLER_CFLAGS $GTK_CFLAGS $GLIB_CFLAGS"
  1041. AC_CHECK_DECL(POPPLER_DEST_NAMED,
  1042. [AC_DEFINE([HAVE_POPPLER_DEST_NAMED], [], [Description])],
  1043. ,[#include <poppler-action.h>])
  1044. AC_CHECK_DECL(POPPLER_DEST_XYZ,
  1045. [AC_DEFINE([HAVE_POPPLER_DEST_XYZ], [], [Description])],
  1046. ,[#include <poppler-action.h>])
  1047. CFLAGS=$OLD_CFLAGS
  1048. fi
  1049. dnl perl ***********************************************************************
  1050. AC_CHECK_PROG(HAVE_PERL, perl, yes, no)
  1051. if test x"$HAVE_PERL" = xyes; then
  1052. AC_MSG_CHECKING(for perl >= 5.8.0)
  1053. PERL_VER=`perl -e 'print $] > 5.0079999?"yes":"no"'`
  1054. if test "$PERL_VER" = "yes"; then
  1055. AC_MSG_RESULT(yes)
  1056. else
  1057. AC_MSG_RESULT(no)
  1058. HAVE_PERL=no
  1059. fi
  1060. fi
  1061. if test x"$HAVE_PERL" = xyes; then
  1062. AC_MSG_CHECKING(for Perl compile flags)
  1063. PERL_CFLAGS=`perl -MExtUtils::Embed -e ccopts`
  1064. PERL_CFLAGS=`echo $PERL_CFLAGS | sed 's/-D_FILE_OFFSET_BITS=[[0-9]]*//'`
  1065. PERL_LDFLAGS=`perl -MExtUtils::Embed -e ldopts |sed 's/-lgdbm\>//'`
  1066. PERL_LDFLAGS=`echo $PERL_LDFLAGS |sed 's/-ldb\>//'`
  1067. PERL_LDFLAGS=`echo $PERL_LDFLAGS |sed 's/-lndbm\>//'`
  1068. PERL_LDFLAGS=`echo $PERL_LDFLAGS |sed 's/-lc\>//'`
  1069. AC_MSG_RESULT(ok)
  1070. AC_MSG_NOTICE([Adding perl LIBS ${PERL_CFLAGS}])
  1071. if test x"$HAVE_PERL" = xyes; then
  1072. AC_CHECK_LIB(perl,perl_alloc,[AC_DEFINE(HAVE_LIBPERL, 1, Check for libperl.)],
  1073. [ HAVE_LIBPERL=no ])
  1074. fi
  1075. if test x"$HAVE_LIBPERL" = xno; then
  1076. LIBPERL_PREFIX=`perl -MExtUtils::Embed -e perl_inc`
  1077. LIBPERL_PREFIX=`echo $LIBPERL_PREFIX |sed 's/-I//'`
  1078. AC_MSG_CHECKING([for libperl.so])
  1079. if test -f "$LIBPERL_PREFIX/libperl.so"; then
  1080. AC_MSG_RESULT(yes)
  1081. HAVE_LIBPERL=yes
  1082. else
  1083. AC_MSG_RESULT(no)
  1084. fi
  1085. fi
  1086. PERL="perl"
  1087. AC_SUBST(PERL)
  1088. AC_SUBST(PERL_CFLAGS)
  1089. AC_SUBST(PERL_LDFLAGS)
  1090. fi
  1091. dnl Gpgme **********************************************************************
  1092. AM_PATH_GPGME(1.0.0, HAVE_GPGME=yes, HAVE_GPGME=no)
  1093. if test x"$HAVE_GPGME" = xyes; then
  1094. AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.)
  1095. AM_PATH_GPGME(1.1.1, AC_DEFINE(HAVE_GPGME_PKA_TRUST, 1, [Define if GPGME supports PKA.]))
  1096. fi
  1097. dnl Python *********************************************************************
  1098. AM_PATH_PYTHON([2.5], [
  1099. AC_PATH_PROG(PYTHON_CONFIG, python$PYTHON_VERSION-config)
  1100. if test x"$PYTHON_CONFIG" = x"" ; then
  1101. AC_PATH_PROG(PYTHON_CONFIG, python-config)
  1102. fi
  1103. if test x"$PYTHON_CONFIG" != x""; then
  1104. PYTHON_CFLAGS=`$PYTHON_CONFIG --includes`
  1105. PYTHON_LIBS=`$PYTHON_CONFIG --libs`
  1106. PYTHON_PREFIX=`$PYTHON_CONFIG --prefix`
  1107. HAVE_PYTHON=yes
  1108. else
  1109. AC_MSG_WARN(python-config not found. Maybe you need to install development packages for Python.)
  1110. HAVE_PYTHON=no
  1111. fi
  1112. if test x"$HAVE_PYTHON" = xyes; then
  1113. _save_libs="$LIBS"
  1114. if test x"$platform_win32" = xno; then
  1115. # libpython.so
  1116. PYTHON_SHARED_LIB="libpython${PYTHON_VERSION}.so"
  1117. AC_CHECK_LIB(dl, dlopen, [LIBS="-ldl"])
  1118. AC_MSG_CHECKING([whether to dlopen $PYTHON_SHARED_LIB works])
  1119. AC_RUN_IFELSE(
  1120. [AC_LANG_PROGRAM(
  1121. [#include <dlfcn.h>
  1122. #define PYTHON_SO_FILE "${PYTHON_SHARED_LIB}"
  1123. ],
  1124. [if (!dlopen(PYTHON_SO_FILE, RTLD_NOW | RTLD_GLOBAL)) return 1; return 0;])
  1125. ],
  1126. [found_libpython_so="yes"],
  1127. [found_libpython_so="no"],
  1128. [AC_MSG_FAILURE([cross-compiling not supported])])
  1129. fi
  1130. if test x"$found_libpython_so" != x"yes"; then
  1131. AC_MSG_RESULT(no)
  1132. AC_MSG_WARN(Could not find Python shared libary: ${PYTHON_SHARED_LIB}. Maybe you need to install development packages for Python.)
  1133. HAVE_PYTHON=no
  1134. else
  1135. AC_MSG_RESULT(yes)
  1136. fi
  1137. LIBS="$_save_libs";
  1138. fi
  1139. if test x"$HAVE_PYTHON" = xyes; then
  1140. PKG_CHECK_MODULES(PYGTK, pygtk-2.0 >= 2.10.3, [AC_DEFINE(ENABLE_PYTHON, [1], [Enable Python support])], HAVE_PYTHON=no)
  1141. fi
  1142. ])
  1143. AC_SUBST(PYTHON_SHARED_LIB)
  1144. AC_SUBST(PYTHON_CFLAGS)
  1145. AC_SUBST(PYTHON_LIBS)
  1146. AC_SUBST(PYGTK_CFLAGS)
  1147. AC_SUBST(PYGTK_LIBS)
  1148. dnl libnotify ******************************************************************
  1149. PKG_CHECK_MODULES(libnotify, libnotify >= 0.4.3, HAVE_LIBNOTIFY=yes, HAVE_LIBNOTIFY=no)
  1150. if test x"$HAVE_LIBNOTIFY" = xyes; then
  1151. AC_DEFINE(HAVE_LIBNOTIFY, 1, [Define if libnotify support is enabled])
  1152. fi
  1153. AC_SUBST(libnotify_CFLAGS)
  1154. AC_SUBST(libnotify_LIBS)
  1155. dnl libcanberra-gtk ************************************************************
  1156. PKG_CHECK_MODULES(libcanberra_gtk, libcanberra-gtk >= 0.6, HAVE_LIBCANBERRA_GTK=yes, HAVE_LIBCANBERRA_GTK=no)
  1157. if test x"$HAVE_LIBCANBERRA_GTK" = xyes; then
  1158. AC_DEFINE(HAVE_LIBCANBERRA_GTK, 1, [Define if libcanberra-gtk support is enabled])
  1159. fi
  1160. AC_SUBST(libcanberra_gtk_CFLAGS)
  1161. AC_SUBST(libcanberra_gtk_LIBS)
  1162. dnl unity/messaging-menu *******************************************************
  1163. PKG_CHECK_MODULES(unity, unity messaging-menu, HAVE_UNITY=yes, HAVE_UNITY=no)
  1164. if test x"$HAVE_UNITY" = xyes; then
  1165. AC_DEFINE(NOTIFICATION_INDICATOR, 1, [Activate support for unity and messaging-menu])
  1166. fi
  1167. AC_SUBST(unity_CFLAGS)
  1168. AC_SUBST(unity_LIBS)
  1169. dnl hotkeys ********************************************************************
  1170. PKG_CHECK_MODULES(CM_NP_HOTKEY, [gio-2.0 >= 2.15.6 gio-unix-2.0 >= 2.15.6], HAVE_HOTKEYS=yes, HAVE_HOTKEYS=no)
  1171. if test x"$HAVE_HOTKEYS" = xyes; then
  1172. AC_DEFINE(NOTIFICATION_HOTKEYS, 1, Activate support for global hotkeys)
  1173. fi
  1174. AC_SUBST(CM_NP_HOTKEY_CFLAGS)
  1175. AC_SUBST(CM_NP_HOTKEY_LIBS)
  1176. dnl libytnef *******************************************************************
  1177. YTNEF_CFLAGS=""
  1178. YTNEF_LIBS=""
  1179. have_ytnef=0
  1180. # Check both ytnef.h and libytnef/ytnef.h, and adjust YTNEF_CFLAGS
  1181. # accordingly
  1182. AC_CHECK_HEADER(ytnef.h, [have_ytnef=1], [have_ytnef=0])
  1183. if test $have_ytnef -eq 0; then
  1184. AC_CHECK_HEADER(libytnef/ytnef.h,
  1185. [have_ytnef=1;
  1186. YTNEF_CFLAGS="${YTNEF_CFLAGS} -DYTNEF_H_SUBDIR"],
  1187. [have_ytnef=0])
  1188. fi
  1189. if test $have_ytnef -eq 1; then
  1190. AC_MSG_CHECKING([how libytnef's SwapDDWord() should be called])
  1191. # Now we have to figure out which libytnef version we're using,
  1192. # based on whether SwapDDWord takes one argument or two.
  1193. if test "x${YTNEF_CFLAGS}" = "x"; then
  1194. ytnef_include="#include <ytnef.h>"
  1195. else
  1196. ytnef_include="#include <libytnef/ytnef.h>"
  1197. fi
  1198. AC_TRY_COMPILE([#include <stdio.h>
  1199. ${ytnef_include}],
  1200. [SwapDDWord(0, 0);],
  1201. [have_ytnef=1],
  1202. [have_ytnef=0])
  1203. if test $have_ytnef -eq 0; then
  1204. AC_TRY_COMPILE([#include <stdio.h>
  1205. ${ytnef_include}],
  1206. [SwapDDWord(0);],
  1207. [have_ytnef=1;
  1208. YTNEF_CFLAGS="${YTNEF_CFLAGS} -DYTNEF_OLD_SWAPDDWORD"],
  1209. [have_ytnef=0])
  1210. fi
  1211. if test $have_ytnef -eq 1; then
  1212. YTNEF_LIBS="-lytnef"
  1213. AC_MSG_RESULT(ok)
  1214. else
  1215. AC_MSG_RESULT(no idea, unsupported libytnef version?)
  1216. fi
  1217. fi
  1218. AC_SUBST(YTNEF_CFLAGS)
  1219. AC_SUBST(YTNEF_LIBS)
  1220. dnl Third, we now cross the requested plugins and the available dependencies
  1221. dnl If some dependencies are missing and the plugin was explicitely enabled,
  1222. dnl we error out, else we only inform.
  1223. AC_MSG_CHECKING([whether to build acpi_notifier plugin])
  1224. if test x"$enable_acpi_notifier_plugin" != xno; then
  1225. PLUGINS="$PLUGINS acpi_notifier"
  1226. AC_MSG_RESULT(yes)
  1227. else
  1228. DISABLED_PLUGINS="$DISABLED_PLUGINS acpi_notifier"
  1229. AC_MSG_RESULT(no)
  1230. fi
  1231. AC_MSG_CHECKING([whether to build address_keeper plugin])
  1232. if test x"$enable_address_keeper_plugin" != xno; then
  1233. PLUGINS="$PLUGINS address_keeper"
  1234. AC_MSG_RESULT(yes)
  1235. else
  1236. DISABLED_PLUGINS="$DISABLED_PLUGINS address_keeper"
  1237. AC_MSG_RESULT(no)
  1238. fi
  1239. AC_MSG_CHECKING([whether to build archive plugin])
  1240. if test x"$enable_archive_plugin" != xno; then
  1241. dependencies_missing=""
  1242. if test x"$HAVE_ARCHIVE" = xno; then
  1243. dependencies_missing="libarchive $dependencies_missing"
  1244. fi
  1245. if test x"$dependencies_missing" = x; then
  1246. PLUGINS="$PLUGINS archive"
  1247. AC_MSG_RESULT(yes)
  1248. elif test x"$enable_archive_plugin" = xauto; then
  1249. AC_MSG_RESULT(no)
  1250. AC_MSG_WARN("Plugin archive will not be built; missing $dependencies_missing")
  1251. enable_archive_plugin=no
  1252. MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS archive"
  1253. else
  1254. AC_MSG_RESULT(no)
  1255. AC_MSG_ERROR("Plugin archive cannot be built; missing $dependencies_missing")
  1256. fi
  1257. else
  1258. DISABLED_PLUGINS="$DISABLED_PLUGINS archive"
  1259. AC_MSG_RESULT(no)
  1260. fi
  1261. AC_MSG_CHECKING([whether to build att_remover plugin])
  1262. if test x"$enable_att_remover_plugin" != xno; then
  1263. PLUGINS="$PLUGINS att_remover"
  1264. AC_MSG_RESULT(yes)
  1265. else
  1266. DISABLED_PLUGINS="$DISABLED_PLUGINS att_remover"
  1267. AC_MSG_RESULT(no)
  1268. fi
  1269. AC_MSG_CHECKING([whether to build attachwarner plugin])
  1270. if test x"$enable_attachwarner_plugin" != xno; then
  1271. PLUGINS="$PLUGINS attachwarner"
  1272. AC_MSG_RESULT(yes)
  1273. else
  1274. DISABLED_PLUGINS="$DISABLED_PLUGINS attachwarner"
  1275. AC_MSG_RESULT(no)
  1276. fi
  1277. AC_MSG_CHECKING([whether to build bogofilter plugin])
  1278. if test x"$enable_bogofilter_plugin" != xno; then
  1279. PLUGINS="$PLUGINS bogofilter"
  1280. AC_MSG_RESULT(yes)
  1281. else
  1282. DISABLED_PLUGINS="$DISABLED_PLUGINS bogofilter"
  1283. AC_MSG_RESULT(no)
  1284. fi
  1285. AC_MSG_CHECKING([whether to build bsfilter plugin])
  1286. if test x"$enable_bsfilter_plugin" != xno; then
  1287. PLUGINS="$PLUGINS bsfilter"
  1288. AC_MSG_RESULT(yes)
  1289. else
  1290. DISABLED_PLUGINS="$DISABLED_PLUGINS bsfilter"
  1291. AC_MSG_RESULT(no)
  1292. fi
  1293. AC_MSG_CHECKING([whether to build clamd plugin])
  1294. if test x"$enable_clamd_plugin" != xno; then
  1295. PLUGINS="$PLUGINS clamd"
  1296. AC_MSG_RESULT(yes)
  1297. else
  1298. DISABLED_PLUGINS="$DISABLED_PLUGINS clamd"
  1299. AC_MSG_RESULT(no)
  1300. fi
  1301. AC_MSG_CHECKING([whether to build demo plugin])
  1302. if test x"$enable_demo_plugin" != xno; then
  1303. PLUGINS="$PLUGINS demo"
  1304. AC_MSG_RESULT(yes)
  1305. else
  1306. DISABLED_PLUGINS="$DISABLED_PLUGINS demo"
  1307. AC_MSG_RESULT(no)
  1308. fi
  1309. AC_MSG_CHECKING([whether to build Dillo plugin])
  1310. if test x"$enable_dillo_plugin" != xno; then
  1311. PLUGINS="$PLUGINS dillo"
  1312. AC_MSG_RESULT(yes)
  1313. else
  1314. DISABLED_PLUGINS="$DISABLED_PLUGINS dillo"
  1315. AC_MSG_RESULT(no)
  1316. fi
  1317. AC_MSG_CHECKING([whether to build fancy plugin])
  1318. if test x"$enable_fancy_plugin" != xno; then
  1319. dependencies_missing=""
  1320. if test x"$HAVE_WEBKIT" = xno; then
  1321. dependencies_missing="libwebkit2gtk-4.0 $dependencies_missing"
  1322. fi
  1323. if test x"$HAVE_CURL" = xno; then
  1324. dependencies_missing="libcurl $dependencies_missing"
  1325. fi
  1326. if test x"$dependencies_missing" = x; then
  1327. PLUGINS="$PLUGINS fancy"
  1328. AC_MSG_RESULT(yes)
  1329. elif test x"$enable_fancy_plugin" = xauto; then
  1330. AC_MSG_RESULT(no)
  1331. AC_MSG_WARN("Plugin fancy will not be built; missing $dependencies_missing")
  1332. enable_fancy_plugin=no
  1333. MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS fancy"
  1334. else
  1335. AC_MSG_RESULT(no)
  1336. AC_MSG_ERROR("Plugin fancy cannot be built; missing $dependencies_missing")
  1337. fi
  1338. else
  1339. DISABLED_PLUGINS="$DISABLED_PLUGINS fancy"
  1340. AC_MSG_RESULT(no)
  1341. fi
  1342. AC_MSG_CHECKING([whether to build fetchinfo plugin])
  1343. if test x"$enable_fetchinfo_plugin" != xno; then
  1344. PLUGINS="$PLUGINS fetchinfo"
  1345. AC_MSG_RESULT(yes)
  1346. else
  1347. DISABLED_PLUGINS="$DISABLED_PLUGINS fetchinfo"
  1348. AC_MSG_RESULT(no)
  1349. fi
  1350. AC_MSG_CHECKING([whether to build gdata plugin])
  1351. if test x"$enable_gdata_plugin" != xno; then
  1352. dependencies_missing=""
  1353. if test x"$HAVE_GDATA" = xno; then
  1354. dependencies_missing="libgdata $dependencies_missing"
  1355. fi
  1356. if test x"$dependencies_missing" = x; then
  1357. PLUGINS="$PLUGINS gdata"
  1358. AC_MSG_RESULT(yes)
  1359. elif test x"$enable_gdata_plugin" = xauto; then
  1360. AC_MSG_RESULT(no)
  1361. AC_MSG_WARN("Plugin gdata will not be built; missing $dependencies_missing")
  1362. enable_gdata_plugin=no
  1363. MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS gdata"
  1364. else
  1365. AC_MSG_RESULT(no)
  1366. AC_MSG_ERROR("Plugin gdata cannot be built; missing $dependencies_missing")
  1367. fi
  1368. else
  1369. DISABLED_PLUGINS="$DISABLED_PLUGINS gdata"
  1370. AC_MSG_RESULT(no)
  1371. fi
  1372. AC_MSG_CHECKING([whether to build libravatar plugin])
  1373. if test x"$enable_libravatar_plugin" != xno; then
  1374. dependencies_missing=""
  1375. if test x"$HAVE_CURL" = xno; then
  1376. dependencies_missing="libcurl $dependencies_missing"
  1377. fi
  1378. if test x"$dependencies_missing" = x; then
  1379. PLUGINS="$PLUGINS libravatar"
  1380. AC_MSG_RESULT(yes)
  1381. elif test x"$enable_libravatar_plugin" = xauto; then
  1382. AC_MSG_RESULT(no)
  1383. AC_MSG_WARN("Plugin libravatar will not be built; missing $dependencies_missing")
  1384. enable_libravatar_plugin=no
  1385. MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS libravatar"
  1386. else
  1387. AC_MSG_RESULT(no)
  1388. AC_MSG_ERROR("Plugin libravatar cannot be built; missing $dependencies_missing")
  1389. fi
  1390. else
  1391. DISABLED_PLUGINS="$DISABLED_PLUGINS libravatar"
  1392. AC_MSG_RESULT(no)
  1393. fi
  1394. AC_MSG_CHECKING([whether to build mailmbox plugin])
  1395. if test x"$enable_mailmbox_plugin" != xno; then
  1396. PLUGINS="$PLUGINS mailmbox"
  1397. AC_MSG_RESULT(yes)
  1398. else
  1399. DISABLED_PLUGINS="$DISABLED_PLUGINS mailmbox"
  1400. AC_MSG_RESULT(no)
  1401. fi
  1402. AC_MSG_CHECKING([whether to build managesieve plugin])
  1403. if test x"$enable_managesieve_plugin" != xno; then
  1404. PLUGINS="$PLUGINS managesieve"
  1405. AC_MSG_RESULT(yes)
  1406. else
  1407. DISABLED_PLUGINS="$DISABLED_PLUGINS managesieve"
  1408. AC_MSG_RESULT(no)
  1409. fi
  1410. AC_MSG_CHECKING([whether to build newmail plugin])
  1411. if test x"$enable_newmail_plugin" != xno; then
  1412. PLUGINS="$PLUGINS newmail"
  1413. AC_MSG_RESULT(yes)
  1414. else
  1415. DISABLED_PLUGINS="$DISABLED_PLUGINS newmail"
  1416. AC_MSG_RESULT(no)
  1417. fi
  1418. AC_MSG_CHECKING([whether to build notification plugin])
  1419. if test x"$enable_notification_plugin" != xno; then
  1420. PLUGINS="$PLUGINS notification"
  1421. AC_MSG_RESULT(yes)
  1422. AC_DEFINE(NOTIFICATION_POPUP, 1, Activate notification popup)
  1423. AC_DEFINE(NOTIFICATION_BANNER, 1, Activate notification banner)
  1424. AC_DEFINE(NOTIFICATION_COMMAND, 1, Activate notification shell command)
  1425. AC_DEFINE(NOTIFICATION_TRAYICON, 1, Activate notification trayicon)
  1426. if test x"$platform_win32" = xno; then
  1427. AC_DEFINE(NOTIFICATION_LCDPROC, 1, Activate lcdproc support)
  1428. fi
  1429. notification_features="banner command"
  1430. notification_missing_dependencies=""
  1431. if test x"$HAVE_HOTKEYS" = xyes; then
  1432. notification_features="$notification_features hotkeys"
  1433. else
  1434. notification_missing_dependencies="$notification_missing_dependencies hotkeys"
  1435. fi
  1436. notification_features="$notification_features lcdproc"
  1437. if test x"$HAVE_UNITY" = xyes; then
  1438. notification_features="$notification_features unity/messaging-menu"
  1439. else
  1440. notification_missing_dependencies="$notification_missing_dependencies unity/messaging-menu"
  1441. fi
  1442. if test x"$HAVE_LIBNOTIFY" = xyes; then
  1443. notification_features="$notification_features libnotify"
  1444. else
  1445. notification_missing_dependencies="$notification_missing_dependencies libnotify"
  1446. fi
  1447. if test x"$HAVE_LIBCANBERRA_GTK" = xyes; then
  1448. notification_features="$notification_features libcanberra-gtk"
  1449. else
  1450. notification_missing_dependencies="$notification_missing_dependencies libcanberra-gtk"
  1451. fi
  1452. notification_features="$notification_features popup trayicon"
  1453. else
  1454. DISABLED_PLUGINS="$DISABLED_PLUGINS notification"
  1455. AC_MSG_RESULT(no)
  1456. fi
  1457. AC_MSG_CHECKING([whether to build pdf_viewer plugin])
  1458. if test x"$enable_pdf_viewer_plugin" != xno; then
  1459. dependencies_missing=""
  1460. if test x"$HAVE_POPPLER" = xno; then
  1461. dependencies_missing="libpoppler-glib $dependencies_missing"
  1462. fi
  1463. if test x"$dependencies_missing" = x; then
  1464. PLUGINS="$PLUGINS pdf_viewer"
  1465. AC_MSG_RESULT(yes)
  1466. elif test x"$enable_pdf_viewer_plugin" = xauto; then
  1467. AC_MSG_RESULT(no)
  1468. AC_MSG_WARN("Plugin pdf_viewer will not be built; missing $dependencies_missing")
  1469. enable_pdf_viewer_plugin=no
  1470. MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS pdf_viewer"
  1471. else
  1472. AC_MSG_RESULT(no)
  1473. AC_MSG_ERROR("Plugin pdf_viewer cannot be built; missing $dependencies_missing")
  1474. fi
  1475. else
  1476. DISABLED_PLUGINS="$DISABLED_PLUGINS pdf_viewer"
  1477. AC_MSG_RESULT(no)
  1478. fi
  1479. AC_MSG_CHECKING([whether to build perl plugin])
  1480. if test x"$enable_perl_plugin" != xno; then
  1481. dependencies_missing=""
  1482. if test x"$HAVE_LIBPERL" = xno; then
  1483. dependencies_missing="libperl $dependencies_missing"
  1484. fi
  1485. if test x"$dependencies_missing" = x; then
  1486. PLUGINS="$PLUGINS perl"
  1487. AC_MSG_RESULT(yes)
  1488. elif test x"$enable_perl_plugin" = xauto; then
  1489. AC_MSG_RESULT(no)
  1490. AC_MSG_WARN("Plugin perl will not be built; missing $dependencies_missing")
  1491. enable_perl_plugin=no
  1492. MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS perl"
  1493. else
  1494. AC_MSG_RESULT(no)
  1495. AC_MSG_ERROR("Plugin perl cannot be built; missing $dependencies_missing")
  1496. fi
  1497. else
  1498. DISABLED_PLUGINS="$DISABLED_PLUGINS perl"
  1499. AC_MSG_RESULT(no)
  1500. fi
  1501. AC_MSG_CHECKING([whether to build python plugin])
  1502. if test x"$enable_python_plugin" != xno; then
  1503. dependencies_missing=""
  1504. if test x"$HAVE_PYTHON" = xno; then
  1505. dependencies_missing="python $dependencies_missing"
  1506. fi
  1507. if test x"$dependencies_missing" = x; then
  1508. PLUGINS="$PLUGINS python"
  1509. AC_MSG_RESULT(yes)
  1510. elif test x"$enable_python_plugin" = xauto; then
  1511. AC_MSG_RESULT(no)
  1512. AC_MSG_WARN("Plugin python will not be built; missing $dependencies_missing")
  1513. enable_python_plugin=no
  1514. MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS python"
  1515. else
  1516. AC_MSG_RESULT(no)
  1517. AC_MSG_ERROR("Plugin python cannot be built; missing $dependencies_missing")
  1518. fi
  1519. else
  1520. DISABLED_PLUGINS="$DISABLED_PLUGINS python"
  1521. AC_MSG_RESULT(no)
  1522. fi
  1523. AC_MSG_CHECKING([whether to build pgpcore plugin])
  1524. if test x"$enable_pgpcore_plugin" != xno; then
  1525. dependencies_missing=""
  1526. if test x"$HAVE_GPGME" = xno; then
  1527. dependencies_missing="libgpgme $dependencies_missing"
  1528. fi
  1529. if test x"$dependencies_missing" = x; then
  1530. PLUGINS="$PLUGINS pgpcore"
  1531. AC_MSG_RESULT(yes)
  1532. elif test x"$enable_pgpcore_plugin" = xauto; then
  1533. AC_MSG_RESULT(no)
  1534. AC_MSG_WARN("Plugin pgpcore will not be built; missing $dependencies_missing")
  1535. enable_pgpcore_plugin=no
  1536. MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS pgpcore"
  1537. else
  1538. AC_MSG_RESULT(no)
  1539. AC_MSG_ERROR("Plugin pgpcore cannot be built; missing $dependencies_missing")
  1540. fi
  1541. else
  1542. DISABLED_PLUGINS="$DISABLED_PLUGINS pgpcore"
  1543. AC_MSG_RESULT(no)
  1544. fi
  1545. AC_MSG_CHECKING([whether to build pgpmime plugin])
  1546. if test x"$enable_pgpmime_plugin" != xno; then
  1547. dependencies_missing=""
  1548. if test x"$HAVE_GPGME" = xno; then
  1549. dependencies_missing="libgpgme $dependencies_missing"
  1550. fi
  1551. if test x"$enable_pgpcore_plugin" = xno; then
  1552. dependencies_missing="pgpcore plugin $dependencies_missing"
  1553. fi
  1554. if test x"$dependencies_missing" = x; then
  1555. PLUGINS="$PLUGINS pgpmime"
  1556. AC_MSG_RESULT(yes)
  1557. elif test x"$enable_pgpmime_plugin" = xauto; then
  1558. AC_MSG_RESULT(no)
  1559. AC_MSG_WARN("Plugin pgpmime will not be built; missing $dependencies_missing")
  1560. enable_pgpmime_plugin=no
  1561. MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS pgpmime"
  1562. else
  1563. AC_MSG_RESULT(no)
  1564. AC_MSG_ERROR("Plugin pgpmime cannot be built; missing $dependencies_missing")
  1565. fi
  1566. else
  1567. DISABLED_PLUGINS="$DISABLED_PLUGINS pgpmime"
  1568. AC_MSG_RESULT(no)
  1569. fi
  1570. AC_MSG_CHECKING([whether to build pgpinline plugin])
  1571. if test x"$enable_pgpinline_plugin" != xno; then
  1572. dependencies_missing=""
  1573. if test x"$HAVE_GPGME" = xno; then
  1574. dependencies_missing="libgpgme $dependencies_missing"
  1575. fi
  1576. if test x"$enable_pgpcore_plugin" = xno; then
  1577. dependencies_missing="pgpcore plugin $dependencies_missing"
  1578. fi
  1579. if test x"$dependencies_missing" = x; then
  1580. PLUGINS="$PLUGINS pgpinline"
  1581. AC_MSG_RESULT(yes)
  1582. elif test x"$enable_pgpinline_plugin" = xauto; then
  1583. AC_MSG_RESULT(no)
  1584. AC_MSG_WARN("Plugin pgpinline will not be built; missing $dependencies_missing")
  1585. enable_pgpinline_plugin=no
  1586. MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS pgpinline"
  1587. else
  1588. AC_MSG_RESULT(no)
  1589. AC_MSG_ERROR("Plugin pgpinline cannot be built; missing $dependencies_missing")
  1590. fi
  1591. else
  1592. DISABLED_PLUGINS="$DISABLED_PLUGINS pgpinline"
  1593. AC_MSG_RESULT(no)
  1594. fi
  1595. AC_MSG_CHECKING([whether to build rssyl plugin])
  1596. if test x"$enable_rssyl_plugin" != xno; then
  1597. dependencies_missing=""
  1598. if test x"$HAVE_EXPAT" = xno; then
  1599. dependencies_missing="expat $dependencies_missing"
  1600. fi
  1601. if test x"$HAVE_CURL" = xno; then
  1602. dependencies_missing="libcurl $dependencies_missing"
  1603. fi
  1604. if test x"$dependencies_missing" = x; then
  1605. PLUGINS="$PLUGINS rssyl"
  1606. AC_MSG_RESULT(yes)
  1607. elif test x"$enable_rssyl_plugin" = xauto; then
  1608. AC_MSG_RESULT(no)
  1609. AC_MSG_WARN("Plugin rssyl will not be built; missing $dependencies_missing")
  1610. enable_rssyl_plugin=no
  1611. MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS rssyl"
  1612. else
  1613. AC_MSG_RESULT(no)
  1614. AC_MSG_ERROR("Plugin rssyl cannot be built; missing $dependencies_missing")
  1615. fi
  1616. else
  1617. DISABLED_PLUGINS="$DISABLED_PLUGINS rssyl"
  1618. AC_MSG_RESULT(no)
  1619. fi
  1620. AC_MSG_CHECKING([whether to build spamassassin plugin])
  1621. if test x"$enable_spamassassin_plugin" != xno; then
  1622. PLUGINS="$PLUGINS spamassassin"
  1623. AC_MSG_RESULT(yes)
  1624. AC_SPAMASSASSIN
  1625. dnl check for zlib (optional)
  1626. spamassassin_zlib=0
  1627. SPAMASSASSIN_CFLAGS=""
  1628. SPAMASSASSIN_LIBS=""
  1629. AC_CHECK_HEADER([zlib.h],
  1630. [AC_DEFINE(HAVE_ZLIB_H,1,[optional zlib support for spamassassin plugin])]
  1631. [spamassassin_zlib=1],
  1632. [spamassassin_zlib=0])
  1633. if test $spamassassin_zlib -eq 1; then
  1634. AC_CHECK_LIB(z, deflate, [spamassassin_zlib=1], [spamassassin_zlib=0])
  1635. AC_MSG_CHECKING([whether to build spamassassin plugin with zlib support])
  1636. if test $spamassassin_zlib -eq 1; then
  1637. AC_MSG_RESULT(yes)
  1638. SPAMASSASSIN_CFLAGS="-DHAVE_LIBZ"
  1639. SPAMASSASSIN_LIBS="-lz"
  1640. else
  1641. AC_MSG_RESULT(no)
  1642. fi
  1643. fi
  1644. AC_SUBST(SPAMASSASSIN_CFLAGS)
  1645. AC_SUBST(SPAMASSASSIN_LIBS)
  1646. else
  1647. DISABLED_PLUGINS="$DISABLED_PLUGINS spamassassin"
  1648. AC_MSG_RESULT(no)
  1649. fi
  1650. AC_MSG_CHECKING([whether to build smime plugin])
  1651. if test x"$enable_smime_plugin" != xno; then
  1652. dependencies_missing=""
  1653. if test x"$HAVE_GPGME" = xno; then
  1654. dependencies_missing="libgpgme $dependencies_missing"
  1655. fi
  1656. if test x"$enable_pgpcore_plugin" = xno; then
  1657. dependencies_missing="pgpcore plugin $dependencies_missing"
  1658. fi
  1659. if test x"$dependencies_missing" = x; then
  1660. PLUGINS="$PLUGINS smime"
  1661. AC_MSG_RESULT(yes)
  1662. elif test x"$enable_smime_plugin" = xauto; then
  1663. AC_MSG_RESULT(no)
  1664. AC_MSG_WARN("Plugin smime will not be built; missing $dependencies_missing")
  1665. enable_smime_plugin=no
  1666. MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS smime"
  1667. else
  1668. AC_MSG_RESULT(no)
  1669. AC_MSG_ERROR("Plugin smime cannot be built; missing $dependencies_missing")
  1670. fi
  1671. else
  1672. DISABLED_PLUGINS="$DISABLED_PLUGINS smime"
  1673. AC_MSG_RESULT(no)
  1674. fi
  1675. AC_MSG_CHECKING([whether to build spam_report plugin])
  1676. if test x"$enable_spam_report_plugin" != xno; then
  1677. dependencies_missing=""
  1678. if test x"$HAVE_CURL" = xno; then
  1679. dependencies_missing="libcurl $dependencies_missing"
  1680. fi
  1681. if test x"$dependencies_missing" = x; then
  1682. PLUGINS="$PLUGINS spam_report"
  1683. AC_MSG_RESULT(yes)
  1684. elif test x"$enable_spam_report_plugin" = xauto; then
  1685. AC_MSG_RESULT(no)
  1686. AC_MSG_WARN("Plugin spam_report will not be built; missing $dependencies_missing")
  1687. enable_spam_report_plugin=no
  1688. MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS spam_report"
  1689. else
  1690. AC_MSG_RESULT(no)
  1691. AC_MSG_ERROR("Plugin spam_report cannot be built; missing $dependencies_missing")
  1692. fi
  1693. else
  1694. DISABLED_PLUGINS="$DISABLED_PLUGINS spam_report"
  1695. AC_MSG_RESULT(no)
  1696. fi
  1697. AC_MSG_CHECKING([whether to build tnef_parse plugin])
  1698. if test x"$enable_tnef_parse_plugin" != xno; then
  1699. dependencies_missing=""
  1700. if test $have_ytnef -eq 0; then
  1701. dependencies_missing="libytnef"
  1702. fi
  1703. if test x"$dependencies_missing" = x; then
  1704. PLUGINS="$PLUGINS tnef_parse"
  1705. AC_MSG_RESULT(yes)
  1706. elif test x"$enable_tnef_parse_plugin" = xauto; then
  1707. AC_MSG_RESULT(no)
  1708. AC_MSG_WARN(Plugin tnef_parse will not be built; missing $dependencies_missing")
  1709. enable_tnef_parse_plugin=no
  1710. MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS tnef_parse"
  1711. else
  1712. AC_MSG_RESULT(no)
  1713. AC_MSG_ERROR(Plugin tnef_parse will not be built; missing $dependencies_missing")
  1714. fi
  1715. else
  1716. DISABLED_PLUGINS="$DISABLED_PLUGINS tnef_parse"
  1717. AC_MSG_RESULT(no)
  1718. fi
  1719. AC_MSG_CHECKING([whether to build vcalendar plugin])
  1720. if test x"$enable_vcalendar_plugin" != xno; then
  1721. dependencies_missing=""
  1722. if test x"$HAVE_CURL" = xno; then
  1723. dependencies_missing="libcurl $dependencies_missing"
  1724. fi
  1725. if test x"$HAVE_LIBICAL" = xno; then
  1726. dependencies_missing="libical $dependencies_missing"
  1727. fi
  1728. if test x"$HAVE_PERL" = xno; then
  1729. dependencies_missing="perl $dependencies_missing"
  1730. fi
  1731. if test x"$dependencies_missing" = x; then
  1732. PLUGINS="$PLUGINS vcalendar"
  1733. AC_MSG_RESULT(yes)
  1734. elif test x"$enable_vcalendar_plugin" = xauto; then
  1735. AC_MSG_RESULT(no)
  1736. AC_MSG_WARN("Plugin vcalendar will not be built; missing $dependencies_missing")
  1737. enable_vcalendar_plugin=no
  1738. MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS vcalendar"
  1739. else
  1740. AC_MSG_RESULT(no)
  1741. AC_MSG_ERROR("Plugin vcalendar cannot be built; missing $dependencies_missing")
  1742. fi
  1743. else
  1744. DISABLED_PLUGINS="$DISABLED_PLUGINS vcalendar"
  1745. AC_MSG_RESULT(no)
  1746. fi
  1747. dnl And finally the automake conditionals.
  1748. AM_CONDITIONAL(BUILD_ACPI_NOTIFIER_PLUGIN, test x"$enable_acpi_notifier_plugin" != xno)
  1749. AM_CONDITIONAL(BUILD_ADDRESS_KEEPER_PLUGIN, test x"$enable_address_keeper_plugin" != xno)
  1750. AM_CONDITIONAL(BUILD_ARCHIVE_PLUGIN, test x"$enable_archive_plugin" != xno)
  1751. AM_CONDITIONAL(BUILD_ATT_REMOVER_PLUGIN, test x"$enable_att_remover_plugin" != xno)
  1752. AM_CONDITIONAL(BUILD_ATTACHWARNER_PLUGIN, test x"$enable_attachwarner_plugin" != xno)
  1753. AM_CONDITIONAL(BUILD_BOGOFILTER_PLUGIN, test x"$enable_bogofilter_plugin" != xno)
  1754. AM_CONDITIONAL(BUILD_BSFILTER_PLUGIN, test x"$enable_bsfilter_plugin" != xno)
  1755. AM_CONDITIONAL(BUILD_CLAMD_PLUGIN, test x"$enable_clamd_plugin" != xno)
  1756. AM_CONDITIONAL(BUILD_DEMO_PLUGIN, test x"$enable_demo_plugin" != xno)
  1757. AM_CONDITIONAL(BUILD_DILLO_PLUGIN, test x"$enable_dillo_plugin" != xno)
  1758. AM_CONDITIONAL(BUILD_FANCY_PLUGIN, test x"$enable_fancy_plugin" != xno)
  1759. AM_CONDITIONAL(BUILD_FETCHINFO_PLUGIN, test x"$enable_fetchinfo_plugin" != xno)
  1760. AM_CONDITIONAL(BUILD_GDATA_PLUGIN, test x"$enable_gdata_plugin" != xno)
  1761. AM_CONDITIONAL(BUILD_LIBRAVATAR_PLUGIN, test x"$enable_libravatar_plugin" != xno)
  1762. AM_CONDITIONAL(BUILD_MAILMBOX_PLUGIN, test x"$enable_mailmbox_plugin" != xno)
  1763. AM_CONDITIONAL(BUILD_MANAGESIEVE_PLUGIN, test x"$enable_managesieve_plugin" != xno)
  1764. AM_CONDITIONAL(BUILD_NEWMAIL_PLUGIN, test x"$enable_newmail_plugin" != xno)
  1765. AM_CONDITIONAL(BUILD_NOTIFICATION_PLUGIN, test x"$enable_notification_plugin" != xno)
  1766. AM_CONDITIONAL(BUILD_HOTKEYS, test x"$enable_notification_plugin" != xno -a x"$HAVE_HOTKEYS" = xyes)
  1767. AM_CONDITIONAL(BUILD_PDF_VIEWER_PLUGIN, test x"$enable_pdf_viewer_plugin" != xno)
  1768. AM_CONDITIONAL(BUILD_PERL_PLUGIN, test x"$enable_perl_plugin" != xno)
  1769. AM_CONDITIONAL(BUILD_PYTHON_PLUGIN, test x"$enable_python_plugin" != xno)
  1770. AM_CONDITIONAL(BUILD_PGPCORE_PLUGIN, test x"$enable_pgpcore_plugin" != xno)
  1771. AM_CONDITIONAL(BUILD_PGPMIME_PLUGIN, test x"$enable_pgpmime_plugin" != xno)
  1772. AM_CONDITIONAL(BUILD_PGPINLINE_PLUGIN, test x"$enable_pgpinline_plugin" != xno)
  1773. AM_CONDITIONAL(BUILD_RSSYL_PLUGIN, test x"$enable_rssyl_plugin" != xno)
  1774. AM_CONDITIONAL(BUILD_SMIME_PLUGIN, test x"$enable_smime_plugin" != xno)
  1775. AM_CONDITIONAL(BUILD_SPAMASSASSIN_PLUGIN, test x"$enable_spamassassin_plugin" != xno)
  1776. AM_CONDITIONAL(BUILD_SPAM_REPORT_PLUGIN, test x"$enable_spam_report_plugin" != xno)
  1777. AM_CONDITIONAL(BUILD_TNEF_PARSE_PLUGIN, test x"$enable_tnef_parse_plugin" != xno)
  1778. AM_CONDITIONAL(BUILD_VCALENDAR_PLUGIN, test x"$enable_vcalendar_plugin" != xno)
  1779. dnl ****************************
  1780. dnl ** Final configure output **
  1781. dnl ****************************
  1782. AC_OUTPUT([
  1783. Makefile
  1784. m4/Makefile
  1785. po/Makefile.in
  1786. src/common/version.h
  1787. src/Makefile
  1788. src/common/Makefile
  1789. src/common/passcrypt.h
  1790. src/common/tests/Makefile
  1791. src/gtk/Makefile
  1792. src/etpan/Makefile
  1793. src/plugins/Makefile
  1794. src/plugins/acpi_notifier/Makefile
  1795. src/plugins/address_keeper/Makefile
  1796. src/plugins/archive/Makefile
  1797. src/plugins/att_remover/Makefile
  1798. src/plugins/attachwarner/Makefile
  1799. src/plugins/bogofilter/Makefile
  1800. src/plugins/bsfilter/Makefile
  1801. src/plugins/clamd/Makefile
  1802. src/plugins/clamd/libclamd/Makefile
  1803. src/plugins/demo/Makefile
  1804. src/plugins/dillo/Makefile
  1805. src/plugins/fancy/Makefile
  1806. src/plugins/fetchinfo/Makefile
  1807. src/plugins/gdata/Makefile
  1808. src/plugins/libravatar/Makefile
  1809. src/plugins/mailmbox/Makefile
  1810. src/plugins/managesieve/Makefile
  1811. src/plugins/newmail/Makefile
  1812. src/plugins/notification/Makefile
  1813. src/plugins/notification/gtkhotkey/Makefile
  1814. src/plugins/pdf_viewer/Makefile
  1815. src/plugins/perl/Makefile
  1816. src/plugins/perl/tools/Makefile
  1817. src/plugins/python/Makefile
  1818. src/plugins/python/examples/Makefile
  1819. src/plugins/pgpcore/Makefile
  1820. src/plugins/pgpmime/Makefile
  1821. src/plugins/pgpinline/Makefile
  1822. src/plugins/rssyl/Makefile
  1823. src/plugins/rssyl/tests/Makefile
  1824. src/plugins/rssyl/libfeed/Makefile
  1825. src/plugins/rssyl/libfeed/tests/Makefile
  1826. src/plugins/smime/Makefile
  1827. src/plugins/spamassassin/Makefile
  1828. src/plugins/spam_report/Makefile
  1829. src/plugins/tnef_parse/Makefile
  1830. src/plugins/vcalendar/Makefile
  1831. src/tests/Makefile
  1832. doc/Makefile
  1833. doc/man/Makefile
  1834. tools/Makefile
  1835. config/Makefile
  1836. manual/Makefile
  1837. manual/dtd/Makefile
  1838. manual/dist/Makefile
  1839. manual/dist/pdf/Makefile
  1840. manual/dist/ps/Makefile
  1841. manual/dist/html/Makefile
  1842. manual/dist/txt/Makefile
  1843. manual/fr/Makefile
  1844. manual/fr/dist/Makefile
  1845. manual/fr/dist/pdf/Makefile
  1846. manual/fr/dist/ps/Makefile
  1847. manual/fr/dist/html/Makefile
  1848. manual/fr/dist/txt/Makefile
  1849. manual/es/Makefile
  1850. manual/es/dist/Makefile
  1851. manual/es/dist/pdf/Makefile
  1852. manual/es/dist/ps/Makefile
  1853. manual/es/dist/html/Makefile
  1854. manual/es/dist/txt/Makefile
  1855. claws-mail.pc
  1856. ])
  1857. dnl Output the configuration summary
  1858. echo ""
  1859. echo "$PACKAGE $VERSION"
  1860. echo ""
  1861. if test x"$enable_alternate_addressbook" = xyes; then
  1862. echo "Using Address Book : Alternate experimental interface"
  1863. else
  1864. echo "Using Address Book : Original stable interface"
  1865. echo "JPilot : $enable_jpilot"
  1866. echo "LDAP : $enable_ldap"
  1867. fi
  1868. echo "gnuTLS : $enable_gnutls"
  1869. echo "iconv : $am_cv_func_iconv"
  1870. echo "compface : $enable_compface"
  1871. echo "IPv6 : $enable_ipv6"
  1872. echo "enchant : $enable_enchant"
  1873. echo "IMAP4 : $enable_libetpan"
  1874. echo "NNTP : $enable_libetpan"
  1875. echo "Crash dialog : $enable_crash_dialog"
  1876. echo "LibSM : $enable_libsm"
  1877. echo "DBUS : $enable_dbus"
  1878. echo "NetworkManager : $enable_networkmanager"
  1879. echo "Manual : $enable_manual"
  1880. echo "Generic UMPC code : $enable_generic_umpc"
  1881. echo "SVG support : $enable_svg"
  1882. echo "Config dir : $ac_cv_with_config_dir"
  1883. echo "Password crypto : $pwd_crypto"
  1884. echo "Unit tests : $enable_tests"
  1885. echo "Plugins"
  1886. echo " Built:"
  1887. for plugin in $PLUGINS; do
  1888. echo " - $plugin"
  1889. if test x"$plugin" = xnotification; then
  1890. echo " Features:"
  1891. for notif_feature in $notification_features; do
  1892. echo " $notif_feature"
  1893. done;
  1894. if test "x$notification_missing_dependencies" != x; then
  1895. echo " Disabled due to missing dependencies:"
  1896. for notif_miss_dep in $notification_missing_dependencies; do
  1897. echo " $notif_miss_dep"
  1898. done;
  1899. fi
  1900. fi
  1901. done;
  1902. if test "x$DISABLED_PLUGINS" != x; then
  1903. echo " Disabled:"
  1904. for plugin in $DISABLED_PLUGINS; do
  1905. echo " - $plugin"
  1906. done;
  1907. fi
  1908. if test "x$MISSING_DEPS_PLUGINS" != x; then
  1909. echo " Disabled due to missing dependencies:"
  1910. for plugin in $MISSING_DEPS_PLUGINS; do
  1911. echo " - $plugin"
  1912. done;
  1913. fi
  1914. echo ""
  1915. echo "The binary will be installed in $prefix/bin"
  1916. echo ""
  1917. echo "Configure finished, type 'make' to build."