configure.ac 73 KB

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