configure.ac 72 KB

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