configure.ac 74 KB

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