configure.ac 71 KB

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