configure.ac 73 KB

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