configure.ac 71 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236
  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 el_GR 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. PKG_CHECK_MODULES(GDK_PIXBUF, [gdk-pixbuf-2.0 >= 2.26])
  379. dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
  380. syl_save_LIBS=$LIBS
  381. LIBS="$LIBS $GTK_LIBS"
  382. AC_CHECK_FUNCS(bind_textdomain_codeset)
  383. LIBS=$syl_save_LIBS
  384. dnl check for IPv6 option
  385. dnl automated checks for IPv6 support.
  386. AC_MSG_CHECKING([whether to use IPv6])
  387. if test x"$enable_ipv6" = xyes; then
  388. AC_MSG_RESULT(yes)
  389. AC_MSG_CHECKING([for IPv6 support])
  390. if test x"$platform_win32" = xyes; then
  391. AC_CACHE_VAL(ac_cv_ipv6,[
  392. AC_TRY_COMPILE([
  393. #include <ws2tcpip.h>
  394. ], [struct in6_addr a;],
  395. ac_cv_ipv6=yes, ac_cv_ipv6=no)
  396. ])
  397. else
  398. AC_CACHE_VAL(ac_cv_ipv6,[
  399. AC_TRY_COMPILE([
  400. #define INET6
  401. #include <sys/types.h>
  402. #include <netinet/in.h>
  403. ], [int x = IPPROTO_IPV6; struct in6_addr a;],
  404. ac_cv_ipv6=yes, ac_cv_ipv6=no)
  405. ])
  406. fi
  407. AC_MSG_RESULT($ac_cv_ipv6)
  408. if test $ac_cv_ipv6 = yes; then
  409. AC_DEFINE(INET6, 1, Define if you want IPv6 support.)
  410. else
  411. AC_MSG_WARN(*** IPv6 will not be supported ***)
  412. enable_ipv6=no
  413. fi
  414. else
  415. AC_MSG_RESULT(no)
  416. fi
  417. dnl GNUTLS
  418. AC_MSG_CHECKING([whether to use GnuTLS])
  419. AC_MSG_RESULT($enable_gnutls)
  420. if test "x$enable_gnutls" != "xno"; then
  421. PKG_CHECK_MODULES(GNUTLS, gnutls >= 2.2,
  422. [
  423. AC_DEFINE(USE_GNUTLS, 1, gnutls)
  424. echo "Building with GnuTLS"
  425. PKG_CHECK_MODULES(GNUTLS, gnutls >= 2.11,
  426. [
  427. dnl No linking against libgcrypt needed
  428. ],
  429. [
  430. dnl linking against libgcrypt *is* needed
  431. GNUTLS_LIBS="$GNUTLS_LIBS -lgcrypt"
  432. ])
  433. ],
  434. [
  435. echo "Building without GnuTLS"
  436. AC_MSG_RESULT([*** GnuTLS support is recommended ])
  437. AC_MSG_RESULT([*** You can use --disable-gnutls if you don't need it.])
  438. AC_MSG_ERROR([GnuTLS not found])
  439. ])
  440. AC_SUBST(GNUTLS_LIBS)
  441. AC_SUBST(GNUTLS_CFLAGS)
  442. fi
  443. PKG_CHECK_MODULES(NETTLE, nettle)
  444. AC_SUBST(NETTLE_LIBS)
  445. AC_ARG_WITH(passcrypt-key, [ --with-passcrypt-key=KEY Key used to encode passwords (8 byte string)],
  446. with_passcrypt_key="$withval", with_passcrypt_key="passkey0")
  447. AC_SUBST(PASSCRYPT_KEY, $with_passcrypt_key)
  448. dnl RC dir (will be default at a certain point in time)
  449. AC_ARG_WITH(config-dir, [ --with-config-dir=RCDIR Local configuration dir (default: .claws-mail)],
  450. ac_cv_with_config_dir="$withval", ac_cv_with_config_dir="")
  451. dnl Set correct default value based on platform
  452. if test x"$ac_cv_with_config_dir" = x""; then
  453. if test x"$platform_win32" = xyes; then
  454. ac_cv_with_config_dir="Claws-mail"
  455. else
  456. ac_cv_with_config_dir=".claws-mail"
  457. fi
  458. fi
  459. AC_DEFINE_UNQUOTED(CFG_RC_DIR, "$ac_cv_with_config_dir", Configuration directory)
  460. AC_ARG_WITH(password-encryption, [ --with-password-encryption=PROVIDER Which cryptographic library to use for encrypting stored passwords (gnutls, old, default)],
  461. pwd_crypto="$withval", pwd_crypto="default")
  462. if test x"$pwd_crypto" = xdefault; then
  463. if test x"$enable_gnutls" = xyes; then
  464. if `$PKG_CONFIG --atleast-version=3.0 gnutls`; then
  465. pwd_crypto="gnutls"
  466. fi
  467. fi
  468. fi
  469. if test x"$pwd_crypto" = xdefault; then
  470. pwd_crypto="old"
  471. fi
  472. case $pwd_crypto in
  473. gnutls)
  474. if test x"$enable_gnutls" = xno; then
  475. AC_MSG_ERROR([GnuTLS password encryption requested but GnuTLS is not available.])
  476. fi
  477. if ! `$PKG_CONFIG --atleast-version=3.0 gnutls`; then
  478. AC_MSG_ERROR([GnuTLS version at least 3.0 is required for password encryption.])
  479. fi
  480. AC_DEFINE(PASSWORD_CRYPTO_GNUTLS, 1, Use GnuTLS for stored password encryption)
  481. ;;
  482. old)
  483. AC_DEFINE(PASSWORD_CRYPTO_OLD, 1, Use old insecure method for stored password encryption)
  484. ;;
  485. *)
  486. AC_MSG_ERROR([Unknown password encryption provider requested.])
  487. ;;
  488. esac
  489. dnl ************************
  490. dnl ** GTK user interface **
  491. dnl ************************
  492. dnl Checks for GTK
  493. PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.24)
  494. AC_ARG_ENABLE(deprecated,
  495. [ --disable-deprecated Disable deprecated GTK functions],
  496. [GTK_CFLAGS="$GTK_CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"], [])
  497. dnl Make sure the code does not regress to using deprecated GTK stuff...
  498. GTK_CFLAGS="$GTK_CFLAGS -DGTK_DISABLE_SINGLE_INCLUDES -DGSEAL_ENABLE"
  499. AC_SUBST(GTK_CFLAGS)
  500. AC_SUBST(GTK_LIBS)
  501. dnl enchant is used for spell checking
  502. AC_MSG_CHECKING([whether to use enchant])
  503. AC_MSG_RESULT($enable_enchant)
  504. if test $enable_enchant = yes; then
  505. PKG_CHECK_MODULES(ENCHANT, enchant >= 1.4.0,
  506. [
  507. AC_DEFINE(USE_ENCHANT, 1, enchant)
  508. echo "Building with enchant"
  509. enable_enchant=yes
  510. ],
  511. [
  512. PKG_CHECK_MODULES(ENCHANT, enchant-2 >= 2.0.0,
  513. [
  514. AC_DEFINE(USE_ENCHANT, 1, enchant-2)
  515. echo "Building with enchant-2"
  516. enable_enchant=yes
  517. ],
  518. [
  519. echo "Building without enchant-notification"
  520. enable_enchant=no
  521. ])
  522. ])
  523. AC_SUBST(ENCHANT_CFLAGS)
  524. AC_SUBST(ENCHANT_LIBS)
  525. fi
  526. dnl want crash dialog
  527. if test $enable_crash_dialog = yes; then
  528. dnl check if GDB is somewhere
  529. AC_CHECK_PROG(enable_crash_dialog, gdb, yes, no)
  530. AC_MSG_CHECKING([whether to use crash dialog])
  531. if test $enable_crash_dialog = yes; then
  532. AC_DEFINE(CRASH_DIALOG, 1, Pop up crash dialog)
  533. fi
  534. AC_MSG_RESULT($enable_crash_dialog)
  535. fi
  536. dnl generic umpc
  537. if test $enable_generic_umpc = yes; then
  538. AC_DEFINE(GENERIC_UMPC, 1, Generic UMPC code)
  539. AC_MSG_RESULT($enable_generic_umpc)
  540. fi
  541. dnl Check for X-Face support
  542. AC_MSG_CHECKING([whether to use compface])
  543. if test x"$enable_compface" = xyes; then
  544. AC_MSG_RESULT(yes)
  545. AC_CHECK_LIB(compface, uncompface,
  546. [AC_DEFINE(HAVE_LIBCOMPFACE, 1, Define if you want compface support.)],
  547. [enable_compface=no])
  548. if test x"$enable_compface" = xyes; then
  549. COMPFACE_LIBS="-lcompface"
  550. else
  551. COMPFACE_LIBS=""
  552. fi
  553. AC_SUBST(COMPFACE_LIBS)
  554. else
  555. AC_MSG_RESULT(no)
  556. fi
  557. dnl check for pthread support
  558. AC_MSG_CHECKING([whether to use pthread])
  559. if test x$enable_pthread = xno; then
  560. AC_MSG_RESULT(no)
  561. else
  562. AC_MSG_RESULT(yes)
  563. # For W32 we need to use a special ptrhead lib. In this case we can't
  564. # use AC_CHECK_LIB because it has no means of checking for a
  565. # library installed under a different name. Checking for the
  566. # header is okay.
  567. if test -n "${pthread_name}" ; then
  568. enable_pthread=yes
  569. else
  570. AC_CHECK_LIB(pthread, pthread_create, :, enable_pthread=no)
  571. fi
  572. AC_CHECK_HEADERS(pthread.h, :, enable_pthread=no)
  573. if test x$enable_pthread = xyes; then
  574. AC_DEFINE(USE_PTHREAD, 1, Define if you have pthread)
  575. if test -z "${pthread_name}" ; then
  576. PTHREAD_LIBS="-lpthread"
  577. fi
  578. fi
  579. fi
  580. AC_SUBST(PTHREAD_LIBS)
  581. dnl
  582. dnl Check whether we need to pass -lresolv
  583. dnl We know that we don't need it for W32.
  584. dnl
  585. if test x$os_win32 = xno; then
  586. t_oldLibs="$LIBS"
  587. LIBS="$LIBS"
  588. ac_cv_var__res_options=no
  589. AC_TRY_LINK([#include <sys/types.h>
  590. #include <sys/socket.h>
  591. #include <netinet/in.h>
  592. #include <arpa/nameser.h>
  593. #include <resolv.h>],
  594. [_res.options = RES_INIT;],
  595. ac_cv_var__res_options=yes);
  596. if test "$ac_cv_var__res_options" != "yes"; then
  597. LIBRESOLV="-lresolv"
  598. fi
  599. LIBS="$t_oldLibs"
  600. if test "x$LIBRESOLV" = "x"; then
  601. AC_CHECK_LIB(resolv, res_query, [LIBRESOLV=-lresolv])
  602. LIBS="$t_oldLibs"
  603. fi
  604. fi
  605. AC_SUBST(LIBRESOLV)
  606. LIBS="$LIBS $LIBRESOLV"
  607. dnl #######################################################################
  608. dnl # Check for startup notification
  609. dnl #######################################################################
  610. if test "x$enable_startup_notification" = "xyes"; then
  611. PKG_CHECK_MODULES(STARTUP_NOTIFICATION, libstartup-notification-1.0 >= 0.5,
  612. [
  613. AC_DEFINE(HAVE_STARTUP_NOTIFICATION, 1, [Define if we're using libstartup-notification.])
  614. echo "Building with libstartup-notification"
  615. enable_startup_notification=yes
  616. ],
  617. [
  618. echo "Building without libstartup-notification"
  619. enable_startup_notification=no
  620. ])
  621. AC_SUBST(STARTUP_NOTIFICATION_CFLAGS)
  622. AC_SUBST(STARTUP_NOTIFICATION_LIBS)
  623. fi
  624. dnl #######################################################################
  625. dnl # Check for D-Bus support
  626. dnl #######################################################################
  627. if test "x$enable_dbus" = "xyes"; then
  628. PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.60, dbus-glib-1 >= 0.60],
  629. [
  630. AC_DEFINE(HAVE_DBUS_GLIB, 1, [Define if glib bindings of D-Bus are available])
  631. enable_dbus=yes
  632. ],
  633. [
  634. echo "D-Bus requirements not met. D-Bus support not activated."
  635. enable_dbus=no
  636. ])
  637. AC_SUBST(DBUS_CFLAGS)
  638. AC_SUBST(DBUS_LIBS)
  639. fi
  640. dnl #######################################################################
  641. dnl # Configure address book support
  642. dnl #######################################################################
  643. dnl #######################################################################
  644. dnl # Check for alternate address book support
  645. dnl #######################################################################
  646. AC_MSG_CHECKING([whether DBUS support for alternate address book is present])
  647. if test x"$enable_dbus" = xyes; then
  648. AC_MSG_RESULT([yes])
  649. AC_MSG_CHECKING([whether to enable alternate address book])
  650. if test x"$enable_alternate_addressbook" = xyes; then
  651. AC_MSG_RESULT([yes])
  652. PKG_CHECK_MODULES(CONTACTS, [claws-contacts],
  653. [
  654. AC_DEFINE(USE_ALT_ADDRBOOK, 1, [Define if alternate address book is to be activated.])
  655. enable_alternate_addressbook=yes
  656. AC_SUBST(CONTACTS_CFLAGS)
  657. AC_SUBST(CONTACTS_LIBS)
  658. ],
  659. [
  660. enable_alternate_addressbook=no
  661. ])
  662. else
  663. AC_MSG_RESULT([no])
  664. enable_alternate_addressbook=no
  665. fi
  666. else
  667. AC_MSG_RESULT([no])
  668. enable_alternate_addressbook=no
  669. fi
  670. dnl #######################################################################
  671. dnl # Check for old address book support
  672. dnl #######################################################################
  673. if test x"$enable_alternate_addressbook" = xno; then
  674. dnl for LDAP support in addressbook
  675. dnl no check for libraries; dynamically loaded
  676. AC_MSG_CHECKING([whether to use LDAP])
  677. if test x"$enable_ldap" = xno; then
  678. AC_MSG_RESULT(no)
  679. elif test x"$enable_ldap" = xyes -a x"$enable_pthread" = xno; then
  680. AC_MSG_RESULT(no - LDAP support needs pthread support)
  681. enable_ldap=no
  682. elif test x"$platform_win32" = xyes; then
  683. AC_MSG_RESULT(yes)
  684. AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
  685. LDAP_LIBS="-lwldap32"
  686. AC_SUBST(LDAP_LIBS)
  687. else
  688. AC_MSG_RESULT(yes)
  689. dnl check for available libraries, and pull them in
  690. AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="$LDAP_LIBS -lresolv")
  691. AC_CHECK_LIB(socket, bind, LDAP_LIBS="$LDAP_LIBS -lsocket")
  692. AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl")
  693. AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS="$LDAP_LIBS -llber",,
  694. $LDAP_LIBS)
  695. AC_CHECK_HEADERS(ldap.h lber.h,
  696. [ enable_ldap=yes ],
  697. [ enable_ldap=no ])
  698. if test "$enable_ldap" = yes; then
  699. AC_CHECK_LIB(ldap, ldap_open,
  700. [ enable_ldap=yes ],
  701. [ enable_ldap=no ],
  702. $LDAP_LIBS)
  703. AC_CHECK_LIB(ldap, ldap_start_tls_s,
  704. [ ac_cv_have_tls=yes ],
  705. [ ac_cv_have_tls=no ])
  706. fi
  707. AC_MSG_CHECKING([whether ldap library is available])
  708. AC_MSG_RESULT($enable_ldap)
  709. AC_MSG_CHECKING([whether TLS library is available])
  710. AC_MSG_RESULT($ac_cv_have_tls)
  711. if test "$enable_ldap" = yes; then
  712. AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
  713. LDAP_LIBS="$LDAP_LIBS -lldap"
  714. AC_SUBST(LDAP_LIBS)
  715. if test "$ac_cv_have_tls" = yes; then
  716. AC_DEFINE(USE_LDAP_TLS, 1, Define if you want LDAP TLS support in addressbook.)
  717. fi
  718. dnl As of OpenLDAP API version 3000 a number of functions has
  719. dnl been deprecated. As Claws-mail compiles and runs on many
  720. dnl platforms and many versions of OpenLDAP we need to be able
  721. dnl to switch between the old and new API because new API has
  722. dnl added new functions replacing old ones and at the same time
  723. dnl old functions has been changed.
  724. dnl If cross-compiling defaults to enable deprecated features
  725. dnl for maximum portability
  726. AC_MSG_CHECKING([The API version of OpenLDAP])
  727. AC_RUN_IFELSE(
  728. [AC_LANG_PROGRAM(
  729. [#include <ldap.h>],
  730. [if (LDAP_API_VERSION >= 3000)
  731. return 1
  732. ])],
  733. [AC_MSG_RESULT([version < 3000])
  734. AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 0, Define if OpenLDAP API is at least version 3000.)],
  735. [AC_MSG_RESULT([version >= 3000])
  736. AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 1, Define if OpenLDAP API is at least version 3000.)],
  737. [AC_MSG_RESULT([Enabling deprecated features in OpenLDAP])
  738. AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 0, Define if OpenLDAP API is at least version 3000.)
  739. AC_DEFINE(LDAP_DEPRECATED, 1, Define to activate deprecated features in OpenLDAP)]
  740. )
  741. fi
  742. fi
  743. dnl for JPilot support in addressbook
  744. dnl no check for libraries; these are dynamically loaded
  745. AC_MSG_CHECKING([whether to use JPilot])
  746. if test "$enable_jpilot" = yes; then
  747. AC_MSG_RESULT(yes)
  748. AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h pi-version.h,
  749. [ AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ],
  750. [ enable_jpilot=no ])
  751. if test "$enable_jpilot" = no; then
  752. AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h libpisock/pi-version.h,
  753. [ enable_jpilot=yes
  754. AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ])
  755. fi
  756. AC_CHECK_LIB(pisock, unpack_Address, [JPILOT_LIBS="-lpisock"], [JPILOT_LIBS="" enable_jpilot="no"])
  757. if test x"$enable_jpilot" = xyes; then
  758. AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.)
  759. else
  760. AC_MSG_NOTICE([JPilot support not available])
  761. fi
  762. AC_SUBST(JPILOT_LIBS)
  763. else
  764. AC_MSG_RESULT(no)
  765. fi
  766. fi
  767. AM_CONDITIONAL(BUILD_ALTADDRBOOK, test x"$enable_alternate_addressbook" = x"yes")
  768. dnl #######################################################################
  769. dnl # Check for NetworkManager support
  770. dnl #######################################################################
  771. if test x"$enable_dbus" = xyes; then
  772. if test x"$enable_networkmanager" = xyes; then
  773. PKG_CHECK_MODULES(NETWORKMANAGER_SUPPORT, libnm,
  774. [
  775. AC_DEFINE(HAVE_NETWORKMANAGER_SUPPORT, 1, [Define if NetworkManager support is to be included.])
  776. echo "Building with NetworkManager support"
  777. enable_networkmanager=yes
  778. ],
  779. [
  780. echo "NetworkManager not found."
  781. enable_networkmanager=no
  782. ])
  783. AC_SUBST(NETWORKMANAGER_SUPPORT_CFLAGS)
  784. fi
  785. else
  786. echo "NetworkManager support deactivated as D-Bus requirements were not met."
  787. enable_networkmanager=no
  788. fi
  789. dnl Libetpan
  790. AC_MSG_CHECKING([whether to use libetpan])
  791. if test x"$enable_libetpan" = xyes; then
  792. AC_MSG_RESULT(yes)
  793. libetpan_config=no
  794. libetpan_result=no
  795. libetpan_versiontype=0
  796. # since 1.9.4, libetpan uses pkg-config
  797. PKG_CHECK_MODULES([LIBETPAN], [libetpan >= 1.9.4],
  798. [
  799. LIBETPAN_VERSION=`pkg-config --modversion libetpan | $AWK -F. '{printf "%d", ($1 * 10000) + ($2 * 100) + $3}'`
  800. libetpan_config=yes
  801. ],
  802. [
  803. # before 1.9.4, libetpan uses its own libetpan-config script
  804. AC_PATH_PROG(libetpanconfig, [libetpan-config])
  805. if test "x$libetpanconfig" != "x"; then
  806. LIBETPAN_CPPFLAGS="`$libetpanconfig --cflags`"
  807. LIBETPAN_LIBS="`$libetpanconfig --libs`"
  808. # support libetpan version like x.x and x.x.x
  809. libetpan_versiontype=`$libetpanconfig --version | tr -dc . | wc -c`
  810. if test $libetpan_versiontype -eq 1; then
  811. LIBETPAN_VERSION=`$libetpanconfig --version | $AWK -F. '{printf "%d", ($1 * 100) + $2}'`
  812. else
  813. LIBETPAN_VERSION=`$libetpanconfig --version | $AWK -F. '{printf "%d", ($1 * 10000) + ($2 * 100) + $3}'`
  814. fi
  815. libetpan_config=yes
  816. fi
  817. ])
  818. if test "x$libetpan_config" = "xyes"; then
  819. CPPFLAGS="$CPPFLAGS $LIBETPAN_FLAGS"
  820. AC_CHECK_HEADER(libetpan/libetpan.h, [libetpan_result=yes])
  821. if test "x$libetpan_result" = "xyes"; then
  822. AC_MSG_CHECKING([whether libetpan-config hints compiles and links fine])
  823. LIBS="$LIBS $LIBETPAN_LIBS"
  824. AC_TRY_LINK([#include <libetpan/dbstorage.h>], [db_mailstorage_init(NULL, NULL);], [libetpan_result=yes], [libetpan_result=no])
  825. AC_MSG_RESULT([$libetpan_result])
  826. fi
  827. fi
  828. if test "x$libetpan_result" = "xyes"; then
  829. if test $libetpan_versiontype -eq 1; then
  830. if test "$LIBETPAN_VERSION" -lt "57"; then
  831. AC_MSG_RESULT([*** Claws Mail requires libetpan 0.57 or newer. See http://www.etpan.org/])
  832. AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 and/or NNTP support.])
  833. AC_MSG_ERROR([libetpan 0.57 not found])
  834. fi
  835. fi
  836. AC_SUBST(LIBETPAN_FLAGS)
  837. AC_SUBST(LIBETPAN_LIBS)
  838. AC_DEFINE(HAVE_LIBETPAN, 1, Define if you want IMAP and/or NNTP support.)
  839. else
  840. AC_MSG_RESULT([*** Claws Mail requires libetpan 0.57 or newer. See http://www.etpan.org/ ])
  841. AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 and/or NNTP support.])
  842. AC_MSG_ERROR([libetpan 0.57 not found])
  843. fi
  844. else
  845. AC_MSG_RESULT(no)
  846. fi
  847. AM_CONDITIONAL(CLAWS_LIBETPAN, test "x$libetpan_result" = "xyes")
  848. dnl librsvg
  849. AC_MSG_CHECKING([whether to use librsvg])
  850. if test x"$enable_svg" = xyes; then
  851. AC_MSG_RESULT(yes)
  852. PKG_CHECK_MODULES([SVG], [librsvg-2.0 >= 2.39.0 cairo >= 1.0.0],
  853. [
  854. AC_SUBST(SVG_CFLAGS)
  855. AC_SUBST(SVG_LIBS)
  856. AC_DEFINE(HAVE_SVG, 1, [Define if librsvg2 is available for SVG support])
  857. enable_svg=yes
  858. ],
  859. [
  860. AC_MSG_NOTICE([SVG support deactivated as librsvg2 >= 2.39.0 was not found])
  861. enable_svg=no
  862. ])
  863. else
  864. AC_MSG_RESULT(no)
  865. fi
  866. AC_MSG_CHECKING([whether to use valgrind])
  867. if test x$enable_valgrind = xyes; then
  868. AC_MSG_RESULT(yes)
  869. PKG_CHECK_MODULES(VALGRIND, valgrind >= 2.4.0,
  870. enable_valgrind=yes, enable_valgrind=no)
  871. if test x"$enable_valgrind" = xyes; then
  872. AC_DEFINE(HAVE_VALGRIND, 1, Define if you want valgrind support)
  873. else
  874. AC_MSG_RESULT(not found)
  875. fi
  876. else
  877. AC_MSG_RESULT(no)
  878. fi
  879. AM_CONDITIONAL(CLAWS_VALGRIND, test x"$enable_valgrind" = x"yes")
  880. AC_MSG_CHECKING([whether to build unit tests])
  881. if test x$enable_tests = xyes; then
  882. AC_MSG_RESULT(yes)
  883. else
  884. AC_MSG_RESULT(no)
  885. fi
  886. AM_CONDITIONAL(BUILD_TESTS, test "x$enable_tests" = "xyes")
  887. dnl *************************
  888. dnl ** section for plugins **
  889. dnl *************************
  890. PLUGINS=""
  891. DISABLED_PLUGINS=""
  892. MISSING_DEPS_PLUGINS=""
  893. dnl First we set the enabled status - either enabled (yes), auto-enabled (auto)
  894. dnl or (auto-)disabled (no for both)
  895. dnl
  896. dnl All plugins are auto-enabled except for Demo which is just there to help
  897. dnl potential plugins writers.
  898. AC_ARG_ENABLE(acpi_notifier-plugin,
  899. [ --disable-acpi_notifier-plugin Do not build acpi_notifier plugin],
  900. [enable_acpi_notifier_plugin=$enableval], [enable_acpi_notifier_plugin=auto])
  901. AC_ARG_ENABLE(address_keeper-plugin,
  902. [ --disable-address_keeper-plugin Do not build address_keeper plugin],
  903. [enable_address_keeper_plugin=$enableval], [enable_address_keeper_plugin=auto])
  904. AC_ARG_ENABLE(archive-plugin,
  905. [ --disable-archive-plugin Do not build archive plugin],
  906. [enable_archive_plugin=$enableval], [enable_archive_plugin=auto])
  907. AC_ARG_ENABLE(att_remover-plugin,
  908. [ --disable-att_remover-plugin Do not build att_remover plugin],
  909. [enable_att_remover_plugin=$enableval], [enable_att_remover_plugin=auto])
  910. AC_ARG_ENABLE(attachwarner-plugin,
  911. [ --disable-attachwarner-plugin Do not build attachwarner plugin],
  912. [enable_attachwarner_plugin=$enableval], [enable_attachwarner_plugin=auto])
  913. AC_ARG_ENABLE(bogofilter-plugin,
  914. [ --disable-bogofilter-plugin Do not build bogofilter plugin],
  915. [enable_bogofilter_plugin=$enableval], [enable_bogofilter_plugin=auto])
  916. AC_ARG_ENABLE(bsfilter-plugin,
  917. [ --disable-bsfilter-plugin Do not build bsfilter plugin],
  918. [enable_bsfilter_plugin=$enableval], [enable_bsfilter_plugin=auto])
  919. AC_ARG_ENABLE(clamd-plugin,
  920. [ --disable-clamd-plugin Do not build clamd plugin],
  921. [enable_clamd_plugin=$enableval], [enable_clamd_plugin=auto])
  922. AC_ARG_ENABLE(dillo-plugin,
  923. [ --disable-dillo-plugin Do not build dillo plugin],
  924. [enable_dillo_plugin=$enableval], [enable_dillo_plugin=auto])
  925. AC_ARG_ENABLE(fancy-plugin,
  926. [ --disable-fancy-plugin Do not build fancy plugin],
  927. [enable_fancy_plugin=$enableval], [enable_fancy_plugin=auto])
  928. AC_ARG_ENABLE(fetchinfo-plugin,
  929. [ --disable-fetchinfo-plugin Do not build fetchinfo plugin],
  930. [enable_fetchinfo_plugin=$enableval], [enable_fetchinfo_plugin=auto])
  931. AC_ARG_ENABLE(gdata-plugin,
  932. [ --disable-gdata-plugin Do not build gdata plugin],
  933. [enable_gdata_plugin=$enableval], [enable_gdata_plugin=auto])
  934. AC_ARG_ENABLE(libravatar-plugin,
  935. [ --disable-libravatar-plugin Do not build libravatar plugin],
  936. [enable_libravatar_plugin=$enableval], [enable_libravatar_plugin=auto])
  937. AC_ARG_ENABLE(litehtml_viewer-plugin,
  938. [ --disable-litehtml_viewer-plugin Do not build litehtml_viewer plugin],
  939. [enable_litehtml_viewer_plugin=$enableval], [enable_litehtml_viewer_plugin=auto])
  940. AC_ARG_ENABLE(mailmbox-plugin,
  941. [ --disable-mailmbox-plugin Do not build mailmbox plugin],
  942. [enable_mailmbox_plugin=$enableval], [enable_mailmbox_plugin=auto])
  943. AC_ARG_ENABLE(managesieve-plugin,
  944. [ --disable-managesieve-plugin Do not build managesieve plugin],
  945. [enable_managesieve_plugin=$enableval], [enable_managesieve_plugin=auto])
  946. AC_ARG_ENABLE(newmail-plugin,
  947. [ --disable-newmail-plugin Do not build newmail plugin],
  948. [enable_newmail_plugin=$enableval], [enable_newmail_plugin=auto])
  949. AC_ARG_ENABLE(notification-plugin,
  950. [ --disable-notification-plugin Do not build notification plugin],
  951. [enable_notification_plugin=$enableval], [enable_notification_plugin=auto])
  952. AC_ARG_ENABLE(pdf_viewer-plugin,
  953. [ --disable-pdf_viewer-plugin Do not build pdf_viewer plugin],
  954. [enable_pdf_viewer_plugin=$enableval], [enable_pdf_viewer_plugin=auto])
  955. AC_ARG_ENABLE(perl-plugin,
  956. [ --disable-perl-plugin Do not build perl plugin],
  957. [enable_perl_plugin=$enableval], [enable_perl_plugin=auto])
  958. AC_ARG_ENABLE(python-plugin,
  959. [ --disable-python-plugin Do not build python plugin],
  960. [enable_python_plugin=$enableval], [enable_python_plugin=auto])
  961. AC_ARG_ENABLE(pgpcore-plugin,
  962. [ --disable-pgpcore-plugin Do not build pgpcore plugin],
  963. [enable_pgpcore_plugin=$enableval], [enable_pgpcore_plugin=auto])
  964. AC_ARG_ENABLE(pgpmime-plugin,
  965. [ --disable-pgpmime-plugin Do not build pgpmime plugin],
  966. [enable_pgpmime_plugin=$enableval], [enable_pgpmime_plugin=auto])
  967. AC_ARG_ENABLE(pgpinline-plugin,
  968. [ --disable-pgpinline-plugin Do not build pgpinline plugin],
  969. [enable_pgpinline_plugin=$enableval], [enable_pgpinline_plugin=auto])
  970. AC_ARG_ENABLE(rssyl-plugin,
  971. [ --disable-rssyl-plugin Do not build rssyl plugin],
  972. [enable_rssyl_plugin=$enableval], [enable_rssyl_plugin=auto])
  973. AC_ARG_ENABLE(smime-plugin,
  974. [ --disable-smime-plugin Do not build smime plugin],
  975. [enable_smime_plugin=$enableval], [enable_smime_plugin=auto])
  976. AC_ARG_ENABLE(spamassassin-plugin,
  977. [ --disable-spamassassin-plugin Do not build spamassassin plugin],
  978. [enable_spamassassin_plugin=$enableval], [enable_spamassassin_plugin=auto])
  979. AC_ARG_ENABLE(spam_report-plugin,
  980. [ --disable-spam_report-plugin Do not build spam_report plugin],
  981. [enable_spam_report_plugin=$enableval], [enable_spam_report_plugin=auto])
  982. AC_ARG_ENABLE(tnef_parse-plugin,
  983. [ --disable-tnef_parse-plugin Do not build tnef_parse plugin],
  984. [enable_tnef_parse_plugin=$enableval], [enable_tnef_parse_plugin=auto])
  985. AC_ARG_ENABLE(vcalendar-plugin,
  986. [ --disable-vcalendar-plugin Do not build vcalendar plugin],
  987. [enable_vcalendar_plugin=$enableval], [enable_vcalendar_plugin=auto])
  988. dnl disabled by default
  989. AC_ARG_ENABLE(demo-plugin,
  990. [ --enable-demo-plugin Build demo plugin],
  991. [enable_demo_plugin=$enableval], [enable_demo_plugin=no])
  992. dnl Then we check (unconditionnaly) for plugins dependencies
  993. dnl Some dependencies are optional, some mandatory. This is taken care of
  994. dnl later.
  995. dnl
  996. dnl During this dependancy check we do the checks themselves, define HAVE_X to
  997. dnl either yes or no, and do the AC_SUBST calls.
  998. dnl Archive: libarchive
  999. dnl Fancy: Webkit, curl, optionally libsoup-gnome
  1000. dnl Gdata: libgdata
  1001. dnl Litehtml a C++ compiler, >=glib-2.36, cairo, fontconfig, gumbo, curl
  1002. dnl Libravatar: libcurl
  1003. dnl Notification: optionally libnotify unity/messaging-menu
  1004. dnl libcanberra_gtk hotkey
  1005. dnl Pdf-Viewer: libpoppler
  1006. dnl Perl: sed perl
  1007. dnl PGP/Core: libgpgme
  1008. dnl PGP/Mime: pgpcore libgpgme
  1009. dnl PGP/Inline: pgpcore libgpgme
  1010. dnl S/Mime: pgpcore libgpgme
  1011. dnl Python: Python
  1012. dnl RSSyl: expat libcurl
  1013. dnl SpamReport: libcurl
  1014. dnl vCalendar: libcurl, libical
  1015. dnl tnef_parse: libytnef
  1016. dnl libcurl ********************************************************************
  1017. PKG_CHECK_MODULES(CURL, libcurl, HAVE_CURL=yes, HAVE_CURL=no)
  1018. AC_SUBST(CURL_LIBS)
  1019. AC_SUBST(CURL_CFLAGS)
  1020. dnl expat **********************************************************************
  1021. PKG_CHECK_MODULES(EXPAT, expat, HAVE_EXPAT=yes, HAVE_EXPAT=no)
  1022. if test x"$HAVE_EXPAT" = xno; then
  1023. AC_CHECK_HEADER(expat.h, [expat_header=yes], [expat_header=no])
  1024. AC_CHECK_LIB(expat, XML_ParserCreate, [expat_lib=yes], [expat_lib=no])
  1025. if test x"$expat_header" = xyes -a x"$expat_lib"=xyes; then
  1026. HAVE_EXPAT=yes
  1027. EXPAT_CFLAGS=""
  1028. EXPAT_LIBS="-lexpat"
  1029. fi
  1030. fi
  1031. AC_SUBST(EXPAT_CFLAGS)
  1032. AC_SUBST(EXPAT_LIBS)
  1033. dnl webkit *********************************************************************
  1034. PKG_CHECK_MODULES(WEBKIT, webkit-1.0 >= 1.10.0, HAVE_WEBKIT=yes, HAVE_WEBKIT=no)
  1035. AC_SUBST(WEBKIT_LIBS)
  1036. AC_SUBST(WEBKIT_CFLAGS)
  1037. dnl libsoup ********************************************************************
  1038. PKG_CHECK_MODULES(LIBSOUP, libsoup-2.4, HAVE_LIBSOUP=yes, HAVE_LIBSOUP=no)
  1039. if test x"$HAVE_LIBSOUP" = xyes; then
  1040. AC_DEFINE(HAVE_LIBSOUP, 1, [Define if libsoup is available])
  1041. fi
  1042. AC_SUBST(LIBSOUP_CFLAGS)
  1043. AC_SUBST(LIBSOUP_LIBS)
  1044. dnl libsoup-gnome **************************************************************
  1045. PKG_CHECK_MODULES(LIBSOUP_GNOME, libsoup-gnome-2.4 >= 2.26, HAVE_LIBSOUP_GNOME=yes, HAVE_LIBSOUP_GNOME=no)
  1046. if test x"$HAVE_LIBSOUP_GNOME" = xyes; then
  1047. AC_DEFINE(HAVE_LIBSOUP_GNOME, 1, [Define if libsoup_gnome is available])
  1048. fi
  1049. AC_SUBST(LIBSOUP_GNOME_CFLAGS)
  1050. AC_SUBST(LIBSOUP_GNOME_LIBS)
  1051. dnl libarchive *****************************************************************
  1052. PKG_CHECK_MODULES(LIBARCHIVE, libarchive, HAVE_ARCHIVE=yes, HAVE_ARCHIVE=no)
  1053. AC_SUBST(ARCHIVE_LIBS)
  1054. AC_SUBST(ARCHIVE_CFLAGS)
  1055. AC_CHECK_LIB([archive], [archive_read_new],
  1056. ARCHIVE_LIBS=-larchive
  1057. HAVE_ARCHIVE=yes
  1058. AC_SUBST(ARCHIVE_LIBS,$ARCHIVE_CFLAGS),
  1059. HAVE_ARCHIVE=no
  1060. )
  1061. dnl libgdata *******************************************************************
  1062. PKG_CHECK_MODULES(GDATA, libgdata >= 0.17.2, HAVE_GDATA=yes, HAVE_GDATA=no)
  1063. AC_SUBST(GDATA_CFLAGS)
  1064. AC_SUBST(GDATA_LIBS)
  1065. dnl cairo **********************************************************************
  1066. PKG_CHECK_MODULES(CAIRO, cairo >= 1.12.0, HAVE_CAIRO=yes, HAVE_CAIRO=no)
  1067. AC_SUBST(CAIRO_CFLAGS)
  1068. AC_SUBST(CAIRO_LIBS)
  1069. dnl fontconfig *****************************************************************
  1070. PKG_CHECK_MODULES(FONTCONFIG, fontconfig, HAVE_FONTCONFIG=yes, HAVE_FONTCONFIG=no)
  1071. AC_SUBST(FONTCONFIG_CFLAGS)
  1072. AC_SUBST(FONTCONFIG_LIBS)
  1073. dnl gumbo **********************************************************************
  1074. PKG_CHECK_MODULES(LIBGUMBO, gumbo >= 0.10, HAVE_LIBGUMBO=yes, HAVE_LIBGUMBO=no)
  1075. AC_SUBST(LIBGUMBO_CFLAGS)
  1076. AC_SUBST(LIBGUMBO_LIBS)
  1077. dnl libical ********************************************************************
  1078. PKG_CHECK_MODULES(LIBICAL, libical >= 2.0, HAVE_LIBICAL=yes, HAVE_LIBICAL=no)
  1079. AC_SUBST(LIBICAL_CFLAGS)
  1080. AC_SUBST(LIBICAL_LIBS)
  1081. dnl Poppler ********************************************************************
  1082. PKG_CHECK_MODULES(POPPLER, poppler-glib >= 0.12.0, HAVE_POPPLER=yes, HAVE_POPPLER=no)
  1083. AC_SUBST(POPPLER_LIBS)
  1084. AC_SUBST(POPPLER_CFLAGS)
  1085. dnl check for Poppler extra features that we conditionally support
  1086. if test x"$HAVE_POPPLER" = xyes; then
  1087. OLD_CFLAGS=$CFLAGS
  1088. CFLAGS="$POPPLER_CFLAGS $GTK_CFLAGS $GLIB_CFLAGS"
  1089. AC_CHECK_DECL(POPPLER_DEST_NAMED,
  1090. [AC_DEFINE([HAVE_POPPLER_DEST_NAMED], [], [Description])],
  1091. ,[#include <poppler-action.h>])
  1092. AC_CHECK_DECL(POPPLER_DEST_XYZ,
  1093. [AC_DEFINE([HAVE_POPPLER_DEST_XYZ], [], [Description])],
  1094. ,[#include <poppler-action.h>])
  1095. CFLAGS=$OLD_CFLAGS
  1096. fi
  1097. dnl perl ***********************************************************************
  1098. AC_CHECK_PROG(HAVE_PERL, perl, yes, no)
  1099. if test x"$HAVE_PERL" = xyes; then
  1100. AC_MSG_CHECKING(for perl >= 5.8.0)
  1101. PERL_VER=`perl -e 'print $] > 5.0079999?"yes":"no"'`
  1102. if test "$PERL_VER" = "yes"; then
  1103. AC_MSG_RESULT(yes)
  1104. else
  1105. AC_MSG_RESULT(no)
  1106. HAVE_PERL=no
  1107. fi
  1108. fi
  1109. if test x"$HAVE_PERL" = xyes; then
  1110. AC_MSG_CHECKING(for Perl compile flags)
  1111. PERL_CFLAGS=`perl -MExtUtils::Embed -e ccopts`
  1112. PERL_CFLAGS=`echo $PERL_CFLAGS | sed 's/-D_FILE_OFFSET_BITS=[[0-9]]*//'`
  1113. PERL_LDFLAGS=`perl -MExtUtils::Embed -e ldopts |sed 's/-lgdbm\>//'`
  1114. PERL_LDFLAGS=`echo $PERL_LDFLAGS |sed 's/-ldb\>//'`
  1115. PERL_LDFLAGS=`echo $PERL_LDFLAGS |sed 's/-lndbm\>//'`
  1116. PERL_LDFLAGS=`echo $PERL_LDFLAGS |sed 's/-lc\>//'`
  1117. AC_MSG_RESULT(ok)
  1118. AC_MSG_NOTICE([Adding perl LIBS ${PERL_CFLAGS}])
  1119. if test x"$HAVE_PERL" = xyes; then
  1120. AC_CHECK_LIB(perl,perl_alloc,[AC_DEFINE(HAVE_LIBPERL, 1, Check for libperl.)],
  1121. [ HAVE_LIBPERL=no ])
  1122. fi
  1123. if test x"$HAVE_LIBPERL" = xno; then
  1124. LIBPERL_PREFIX=`perl -MExtUtils::Embed -e perl_inc`
  1125. LIBPERL_PREFIX=`echo $LIBPERL_PREFIX |sed 's/-I//'`
  1126. AC_MSG_CHECKING([for libperl.so])
  1127. if test -f "$LIBPERL_PREFIX/libperl.so"; then
  1128. AC_MSG_RESULT(yes)
  1129. HAVE_LIBPERL=yes
  1130. else
  1131. AC_MSG_RESULT(no)
  1132. fi
  1133. fi
  1134. PERL="perl"
  1135. AC_SUBST(PERL)
  1136. AC_SUBST(PERL_CFLAGS)
  1137. AC_SUBST(PERL_LDFLAGS)
  1138. fi
  1139. dnl Gpgme **********************************************************************
  1140. AM_PATH_GPGME(1.0.0, HAVE_GPGME=yes, HAVE_GPGME=no)
  1141. if test x"$HAVE_GPGME" = xyes; then
  1142. AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.)
  1143. AM_PATH_GPGME(1.1.1, AC_DEFINE(HAVE_GPGME_PKA_TRUST, 1, [Define if GPGME supports PKA.]))
  1144. fi
  1145. dnl Python *********************************************************************
  1146. missing_python=""
  1147. PKG_CHECK_MODULES(PYTHON, python2, HAVE_PYTHON=yes, HAVE_PYTHON=no)
  1148. if test x"$HAVE_PYTHON" = xno; then
  1149. missing_python="python2"
  1150. fi
  1151. if test x"$HAVE_PYTHON" = xyes; then
  1152. PKG_CHECK_MODULES(PYGTK, pygtk-2.0 >= 2.10.3, [AC_DEFINE(ENABLE_PYTHON, [1], [Enable Python support])], HAVE_PYTHON=no)
  1153. if test x"$HAVE_PYTHON" = xno; then
  1154. missing_python="pygtk-2.0 >= 2.10.3"
  1155. fi
  1156. fi
  1157. AC_SUBST(PYTHON_SHARED_LIB)
  1158. AC_SUBST(PYTHON_CFLAGS)
  1159. AC_SUBST(PYTHON_LIBS)
  1160. AC_SUBST(PYGTK_CFLAGS)
  1161. AC_SUBST(PYGTK_LIBS)
  1162. dnl libnotify ******************************************************************
  1163. PKG_CHECK_MODULES(libnotify, libnotify >= 0.4.3, HAVE_LIBNOTIFY=yes, HAVE_LIBNOTIFY=no)
  1164. if test x"$HAVE_LIBNOTIFY" = xyes; then
  1165. AC_DEFINE(HAVE_LIBNOTIFY, 1, [Define if libnotify support is enabled])
  1166. fi
  1167. AC_SUBST(libnotify_CFLAGS)
  1168. AC_SUBST(libnotify_LIBS)
  1169. dnl libcanberra-gtk ************************************************************
  1170. PKG_CHECK_MODULES(libcanberra_gtk, libcanberra-gtk >= 0.6, HAVE_LIBCANBERRA_GTK=yes, HAVE_LIBCANBERRA_GTK=no)
  1171. if test x"$HAVE_LIBCANBERRA_GTK" = xyes; then
  1172. AC_DEFINE(HAVE_LIBCANBERRA_GTK, 1, [Define if libcanberra-gtk support is enabled])
  1173. fi
  1174. AC_SUBST(libcanberra_gtk_CFLAGS)
  1175. AC_SUBST(libcanberra_gtk_LIBS)
  1176. dnl unity/messaging-menu *******************************************************
  1177. PKG_CHECK_MODULES(unity, unity messaging-menu, HAVE_UNITY=yes, HAVE_UNITY=no)
  1178. if test x"$HAVE_UNITY" = xyes; then
  1179. AC_DEFINE(NOTIFICATION_INDICATOR, 1, [Activate support for unity and messaging-menu])
  1180. fi
  1181. AC_SUBST(unity_CFLAGS)
  1182. AC_SUBST(unity_LIBS)
  1183. dnl hotkeys ********************************************************************
  1184. 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)
  1185. if test x"$HAVE_HOTKEYS" = xyes; then
  1186. AC_DEFINE(NOTIFICATION_HOTKEYS, 1, Activate support for global hotkeys)
  1187. fi
  1188. AC_SUBST(CM_NP_HOTKEY_CFLAGS)
  1189. AC_SUBST(CM_NP_HOTKEY_LIBS)
  1190. dnl libytnef *******************************************************************
  1191. YTNEF_CFLAGS=""
  1192. YTNEF_LIBS=""
  1193. have_ytnef=0
  1194. # Check both ytnef.h and libytnef/ytnef.h, and adjust YTNEF_CFLAGS
  1195. # accordingly
  1196. AC_CHECK_HEADER(ytnef.h, [have_ytnef=1], [have_ytnef=0])
  1197. if test $have_ytnef -eq 0; then
  1198. AC_CHECK_HEADER(libytnef/ytnef.h,
  1199. [have_ytnef=1;
  1200. YTNEF_CFLAGS="${YTNEF_CFLAGS} -DYTNEF_H_SUBDIR"],
  1201. [have_ytnef=0])
  1202. fi
  1203. if test $have_ytnef -eq 1; then
  1204. AC_MSG_CHECKING([how libytnef's SwapDDWord() should be called])
  1205. # Now we have to figure out which libytnef version we're using,
  1206. # based on whether SwapDDWord takes one argument or two.
  1207. if test "x${YTNEF_CFLAGS}" = "x"; then
  1208. ytnef_include="#include <ytnef.h>"
  1209. else
  1210. ytnef_include="#include <libytnef/ytnef.h>"
  1211. fi
  1212. AC_TRY_COMPILE([#include <stdio.h>
  1213. ${ytnef_include}],
  1214. [SwapDDWord(0, 0);],
  1215. [have_ytnef=1],
  1216. [have_ytnef=0])
  1217. if test $have_ytnef -eq 0; then
  1218. AC_TRY_COMPILE([#include <stdio.h>
  1219. ${ytnef_include}],
  1220. [SwapDDWord(0);],
  1221. [have_ytnef=1;
  1222. YTNEF_CFLAGS="${YTNEF_CFLAGS} -DYTNEF_OLD_SWAPDDWORD"],
  1223. [have_ytnef=0])
  1224. fi
  1225. if test $have_ytnef -eq 1; then
  1226. YTNEF_LIBS="-lytnef"
  1227. AC_MSG_RESULT(ok)
  1228. else
  1229. AC_MSG_RESULT(no idea, unsupported libytnef version?)
  1230. fi
  1231. fi
  1232. AC_SUBST(YTNEF_CFLAGS)
  1233. AC_SUBST(YTNEF_LIBS)
  1234. dnl Third, we now cross the requested plugins and the available dependencies
  1235. dnl If some dependencies are missing and the plugin was explicitely enabled,
  1236. dnl we error out, else we only inform.
  1237. AC_MSG_CHECKING([whether to build acpi_notifier plugin])
  1238. if test x"$enable_acpi_notifier_plugin" != xno; then
  1239. PLUGINS="$PLUGINS acpi_notifier"
  1240. AC_MSG_RESULT(yes)
  1241. else
  1242. DISABLED_PLUGINS="$DISABLED_PLUGINS acpi_notifier"
  1243. AC_MSG_RESULT(no)
  1244. fi
  1245. AC_MSG_CHECKING([whether to build address_keeper plugin])
  1246. if test x"$enable_address_keeper_plugin" != xno; then
  1247. PLUGINS="$PLUGINS address_keeper"
  1248. AC_MSG_RESULT(yes)
  1249. else
  1250. DISABLED_PLUGINS="$DISABLED_PLUGINS address_keeper"
  1251. AC_MSG_RESULT(no)
  1252. fi
  1253. AC_MSG_CHECKING([whether to build archive plugin])
  1254. if test x"$enable_archive_plugin" != xno; then
  1255. dependencies_missing=""
  1256. if test x"$HAVE_ARCHIVE" = xno; then
  1257. dependencies_missing="libarchive $dependencies_missing"
  1258. fi
  1259. if test x"$dependencies_missing" = x; then
  1260. PLUGINS="$PLUGINS archive"
  1261. AC_MSG_RESULT(yes)
  1262. elif test x"$enable_archive_plugin" = xauto; then
  1263. AC_MSG_RESULT(no)
  1264. AC_MSG_WARN("Plugin archive will not be built; missing $dependencies_missing")
  1265. enable_archive_plugin=no
  1266. MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS archive"
  1267. else
  1268. AC_MSG_RESULT(no)
  1269. AC_MSG_ERROR("Plugin archive cannot be built; missing $dependencies_missing")
  1270. fi
  1271. else
  1272. DISABLED_PLUGINS="$DISABLED_PLUGINS archive"
  1273. AC_MSG_RESULT(no)
  1274. fi
  1275. AC_MSG_CHECKING([whether to build att_remover plugin])
  1276. if test x"$enable_att_remover_plugin" != xno; then
  1277. PLUGINS="$PLUGINS att_remover"
  1278. AC_MSG_RESULT(yes)
  1279. else
  1280. DISABLED_PLUGINS="$DISABLED_PLUGINS att_remover"
  1281. AC_MSG_RESULT(no)
  1282. fi
  1283. AC_MSG_CHECKING([whether to build attachwarner plugin])
  1284. if test x"$enable_attachwarner_plugin" != xno; then
  1285. PLUGINS="$PLUGINS attachwarner"
  1286. AC_MSG_RESULT(yes)
  1287. else
  1288. DISABLED_PLUGINS="$DISABLED_PLUGINS attachwarner"
  1289. AC_MSG_RESULT(no)
  1290. fi
  1291. AC_MSG_CHECKING([whether to build bogofilter plugin])
  1292. if test x"$enable_bogofilter_plugin" != xno; then
  1293. PLUGINS="$PLUGINS bogofilter"
  1294. AC_MSG_RESULT(yes)
  1295. else
  1296. DISABLED_PLUGINS="$DISABLED_PLUGINS bogofilter"
  1297. AC_MSG_RESULT(no)
  1298. fi
  1299. AC_MSG_CHECKING([whether to build bsfilter plugin])
  1300. if test x"$enable_bsfilter_plugin" != xno; then
  1301. PLUGINS="$PLUGINS bsfilter"
  1302. AC_MSG_RESULT(yes)
  1303. else
  1304. DISABLED_PLUGINS="$DISABLED_PLUGINS bsfilter"
  1305. AC_MSG_RESULT(no)
  1306. fi
  1307. AC_MSG_CHECKING([whether to build clamd plugin])
  1308. if test x"$enable_clamd_plugin" != xno; then
  1309. PLUGINS="$PLUGINS clamd"
  1310. AC_MSG_RESULT(yes)
  1311. else
  1312. DISABLED_PLUGINS="$DISABLED_PLUGINS clamd"
  1313. AC_MSG_RESULT(no)
  1314. fi
  1315. AC_MSG_CHECKING([whether to build demo plugin])
  1316. if test x"$enable_demo_plugin" != xno; then
  1317. PLUGINS="$PLUGINS demo"
  1318. AC_MSG_RESULT(yes)
  1319. else
  1320. DISABLED_PLUGINS="$DISABLED_PLUGINS demo"
  1321. AC_MSG_RESULT(no)
  1322. fi
  1323. AC_MSG_CHECKING([whether to build Dillo plugin])
  1324. if test x"$enable_dillo_plugin" != xno; then
  1325. PLUGINS="$PLUGINS dillo"
  1326. AC_MSG_RESULT(yes)
  1327. else
  1328. DISABLED_PLUGINS="$DISABLED_PLUGINS dillo"
  1329. AC_MSG_RESULT(no)
  1330. fi
  1331. AC_MSG_CHECKING([whether to build fancy plugin])
  1332. if test x"$enable_fancy_plugin" != xno; then
  1333. dependencies_missing=""
  1334. if test x"$HAVE_WEBKIT" = xno; then
  1335. dependencies_missing="libwebkit-1.0 $dependencies_missing"
  1336. fi
  1337. if test x"$HAVE_CURL" = xno; then
  1338. dependencies_missing="libcurl $dependencies_missing"
  1339. fi
  1340. if test x"$dependencies_missing" = x; then
  1341. PLUGINS="$PLUGINS fancy"
  1342. AC_MSG_RESULT(yes)
  1343. elif test x"$enable_fancy_plugin" = xauto; then
  1344. AC_MSG_RESULT(no)
  1345. AC_MSG_WARN("Plugin fancy will not be built; missing $dependencies_missing")
  1346. enable_fancy_plugin=no
  1347. MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS fancy"
  1348. else
  1349. AC_MSG_RESULT(no)
  1350. AC_MSG_ERROR("Plugin fancy cannot be built; missing $dependencies_missing")
  1351. fi
  1352. else
  1353. DISABLED_PLUGINS="$DISABLED_PLUGINS fancy"
  1354. AC_MSG_RESULT(no)
  1355. fi
  1356. AC_MSG_CHECKING([whether to build fetchinfo plugin])
  1357. if test x"$enable_fetchinfo_plugin" != xno; then
  1358. PLUGINS="$PLUGINS fetchinfo"
  1359. AC_MSG_RESULT(yes)
  1360. else
  1361. DISABLED_PLUGINS="$DISABLED_PLUGINS fetchinfo"
  1362. AC_MSG_RESULT(no)
  1363. fi
  1364. AC_MSG_CHECKING([whether to build gdata plugin])
  1365. if test x"$enable_gdata_plugin" != xno; then
  1366. dependencies_missing=""
  1367. if test x"$HAVE_GDATA" = xno; then
  1368. dependencies_missing="libgdata $dependencies_missing"
  1369. fi
  1370. if test x"$dependencies_missing" = x; then
  1371. PLUGINS="$PLUGINS gdata"
  1372. AC_MSG_RESULT(yes)
  1373. elif test x"$enable_gdata_plugin" = xauto; then
  1374. AC_MSG_RESULT(no)
  1375. AC_MSG_WARN("Plugin gdata will not be built; missing $dependencies_missing")
  1376. enable_gdata_plugin=no
  1377. MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS gdata"
  1378. else
  1379. AC_MSG_RESULT(no)
  1380. AC_MSG_ERROR("Plugin gdata cannot be built; missing $dependencies_missing")
  1381. fi
  1382. else
  1383. DISABLED_PLUGINS="$DISABLED_PLUGINS gdata"
  1384. AC_MSG_RESULT(no)
  1385. fi
  1386. AC_MSG_CHECKING([whether to build libravatar plugin])
  1387. if test x"$enable_libravatar_plugin" != xno; then
  1388. dependencies_missing=""
  1389. if test x"$HAVE_CURL" = xno; then
  1390. dependencies_missing="libcurl $dependencies_missing"
  1391. fi
  1392. if test x"$dependencies_missing" = x; then
  1393. PLUGINS="$PLUGINS libravatar"
  1394. AC_MSG_RESULT(yes)
  1395. elif test x"$enable_libravatar_plugin" = xauto; then
  1396. AC_MSG_RESULT(no)
  1397. AC_MSG_WARN("Plugin libravatar will not be built; missing $dependencies_missing")
  1398. enable_libravatar_plugin=no
  1399. MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS libravatar"
  1400. else
  1401. AC_MSG_RESULT(no)
  1402. AC_MSG_ERROR("Plugin libravatar cannot be built; missing $dependencies_missing")
  1403. fi
  1404. else
  1405. DISABLED_PLUGINS="$DISABLED_PLUGINS libravatar"
  1406. AC_MSG_RESULT(no)
  1407. fi
  1408. AC_MSG_CHECKING([whether to build litehtml_viewer plugin])
  1409. if test x"$enable_litehtml_viewer_plugin" != xno; then
  1410. dependencies_missing=""
  1411. if test x"$HAVE_CXX" = xno; then
  1412. dependencies_missing="C++ compiler $dependencies_missing"
  1413. fi
  1414. PKG_CHECK_EXISTS([glib-2.0 >= 2.36], [],
  1415. [dependencies_missing="glib-2.0 >= 2.36 $dependencies_missing"])
  1416. if test x"$HAVE_CAIRO" = xno; then
  1417. dependencies_missing="cairo $dependencies_missing"
  1418. fi
  1419. if test x"$HAVE_FONTCONFIG" = xno; then
  1420. dependencies_missing="fontconfig $dependencies_missing"
  1421. fi
  1422. if test x"$HAVE_LIBGUMBO" = xno; then
  1423. dependencies_missing="libgumbo $dependencies_missing"
  1424. fi
  1425. if test x"$HAVE_CURL" = xno; then
  1426. dependencies_missing="libcurl $dependencies_missing"
  1427. fi
  1428. if test x"$dependencies_missing" = x; then
  1429. PLUGINS="$PLUGINS litehtml_viewer"
  1430. AC_MSG_RESULT(yes)
  1431. elif test x"$enable_litehtml_viewer_plugin" = xauto; then
  1432. AC_MSG_RESULT(no)
  1433. AC_MSG_WARN("Plugin litehtml_viewer will not be built; missing $dependencies_missing")
  1434. enable_litehtml_viewer_plugin=no
  1435. MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS litehtml_viewer"
  1436. else
  1437. AC_MSG_RESULT(no)
  1438. AC_MSG_ERROR("Plugin litehtml_viewer cannot be built; missing $dependencies_missing")
  1439. fi
  1440. else
  1441. DISABLED_PLUGINS="$DISABLED_PLUGINS litehtml_viewer"
  1442. AC_MSG_RESULT(no)
  1443. fi
  1444. AC_MSG_CHECKING([whether to build mailmbox plugin])
  1445. if test x"$enable_mailmbox_plugin" != xno; then
  1446. PLUGINS="$PLUGINS mailmbox"
  1447. AC_MSG_RESULT(yes)
  1448. else
  1449. DISABLED_PLUGINS="$DISABLED_PLUGINS mailmbox"
  1450. AC_MSG_RESULT(no)
  1451. fi
  1452. AC_MSG_CHECKING([whether to build managesieve plugin])
  1453. if test x"$enable_managesieve_plugin" != xno; then
  1454. PLUGINS="$PLUGINS managesieve"
  1455. AC_MSG_RESULT(yes)
  1456. else
  1457. DISABLED_PLUGINS="$DISABLED_PLUGINS managesieve"
  1458. AC_MSG_RESULT(no)
  1459. fi
  1460. AC_MSG_CHECKING([whether to build newmail plugin])
  1461. if test x"$enable_newmail_plugin" != xno; then
  1462. PLUGINS="$PLUGINS newmail"
  1463. AC_MSG_RESULT(yes)
  1464. else
  1465. DISABLED_PLUGINS="$DISABLED_PLUGINS newmail"
  1466. AC_MSG_RESULT(no)
  1467. fi
  1468. AC_MSG_CHECKING([whether to build notification plugin])
  1469. if test x"$enable_notification_plugin" != xno; then
  1470. PLUGINS="$PLUGINS notification"
  1471. AC_MSG_RESULT(yes)
  1472. AC_DEFINE(NOTIFICATION_POPUP, 1, Activate notification popup)
  1473. AC_DEFINE(NOTIFICATION_BANNER, 1, Activate notification banner)
  1474. AC_DEFINE(NOTIFICATION_COMMAND, 1, Activate notification shell command)
  1475. AC_DEFINE(NOTIFICATION_TRAYICON, 1, Activate notification trayicon)
  1476. if test x"$platform_win32" = xno; then
  1477. AC_DEFINE(NOTIFICATION_LCDPROC, 1, Activate lcdproc support)
  1478. fi
  1479. notification_features="banner command"
  1480. notification_missing_dependencies=""
  1481. if test x"$HAVE_HOTKEYS" = xyes; then
  1482. notification_features="$notification_features hotkeys"
  1483. else
  1484. notification_missing_dependencies="$notification_missing_dependencies hotkeys"
  1485. fi
  1486. notification_features="$notification_features lcdproc"
  1487. if test x"$HAVE_UNITY" = xyes; then
  1488. notification_features="$notification_features unity/messaging-menu"
  1489. else
  1490. notification_missing_dependencies="$notification_missing_dependencies unity/messaging-menu"
  1491. fi
  1492. if test x"$HAVE_LIBNOTIFY" = xyes; then
  1493. notification_features="$notification_features libnotify"
  1494. else
  1495. notification_missing_dependencies="$notification_missing_dependencies libnotify"
  1496. fi
  1497. if test x"$HAVE_LIBCANBERRA_GTK" = xyes; then
  1498. notification_features="$notification_features libcanberra-gtk"
  1499. else
  1500. notification_missing_dependencies="$notification_missing_dependencies libcanberra-gtk"
  1501. fi
  1502. notification_features="$notification_features popup trayicon"
  1503. else
  1504. DISABLED_PLUGINS="$DISABLED_PLUGINS notification"
  1505. AC_MSG_RESULT(no)
  1506. fi
  1507. AC_MSG_CHECKING([whether to build pdf_viewer plugin])
  1508. if test x"$enable_pdf_viewer_plugin" != xno; then
  1509. dependencies_missing=""
  1510. if test x"$HAVE_POPPLER" = xno; then
  1511. dependencies_missing="libpoppler-glib $dependencies_missing"
  1512. fi
  1513. if test x"$dependencies_missing" = x; then
  1514. PLUGINS="$PLUGINS pdf_viewer"
  1515. AC_MSG_RESULT(yes)
  1516. elif test x"$enable_pdf_viewer_plugin" = xauto; then
  1517. AC_MSG_RESULT(no)
  1518. AC_MSG_WARN("Plugin pdf_viewer will not be built; missing $dependencies_missing")
  1519. enable_pdf_viewer_plugin=no
  1520. MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS pdf_viewer"
  1521. else
  1522. AC_MSG_RESULT(no)
  1523. AC_MSG_ERROR("Plugin pdf_viewer cannot be built; missing $dependencies_missing")
  1524. fi
  1525. else
  1526. DISABLED_PLUGINS="$DISABLED_PLUGINS pdf_viewer"
  1527. AC_MSG_RESULT(no)
  1528. fi
  1529. AC_MSG_CHECKING([whether to build perl plugin])
  1530. if test x"$enable_perl_plugin" != xno; then
  1531. dependencies_missing=""
  1532. if test x"$HAVE_LIBPERL" = xno; then
  1533. dependencies_missing="libperl $dependencies_missing"
  1534. fi
  1535. if test x"$dependencies_missing" = x; then
  1536. PLUGINS="$PLUGINS perl"
  1537. AC_MSG_RESULT(yes)
  1538. elif test x"$enable_perl_plugin" = xauto; then
  1539. AC_MSG_RESULT(no)
  1540. AC_MSG_WARN("Plugin perl will not be built; missing $dependencies_missing")
  1541. enable_perl_plugin=no
  1542. MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS perl"
  1543. else
  1544. AC_MSG_RESULT(no)
  1545. AC_MSG_ERROR("Plugin perl cannot be built; missing $dependencies_missing")
  1546. fi
  1547. else
  1548. DISABLED_PLUGINS="$DISABLED_PLUGINS perl"
  1549. AC_MSG_RESULT(no)
  1550. fi
  1551. AC_MSG_CHECKING([whether to build python plugin])
  1552. if test x"$enable_python_plugin" != xno; then
  1553. dependencies_missing=""
  1554. if test x"$HAVE_PYTHON" = xno; then
  1555. dependencies_missing="$missing_python $dependencies_missing"
  1556. fi
  1557. if test x"$dependencies_missing" = x; then
  1558. PLUGINS="$PLUGINS python"
  1559. AC_MSG_RESULT(yes)
  1560. elif test x"$enable_python_plugin" = xauto; then
  1561. AC_MSG_RESULT(no)
  1562. AC_MSG_WARN("Plugin python will not be built; missing $dependencies_missing")
  1563. enable_python_plugin=no
  1564. MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS python"
  1565. else
  1566. AC_MSG_RESULT(no)
  1567. AC_MSG_ERROR("Plugin python cannot be built; missing $dependencies_missing")
  1568. fi
  1569. else
  1570. DISABLED_PLUGINS="$DISABLED_PLUGINS python"
  1571. AC_MSG_RESULT(no)
  1572. fi
  1573. AC_MSG_CHECKING([whether to build pgpcore plugin])
  1574. if test x"$enable_pgpcore_plugin" != xno; then
  1575. dependencies_missing=""
  1576. if test x"$HAVE_GPGME" = xno; then
  1577. dependencies_missing="libgpgme $dependencies_missing"
  1578. fi
  1579. if test x"$dependencies_missing" = x; then
  1580. PLUGINS="$PLUGINS pgpcore"
  1581. AC_MSG_RESULT(yes)
  1582. elif test x"$enable_pgpcore_plugin" = xauto; then
  1583. AC_MSG_RESULT(no)
  1584. AC_MSG_WARN("Plugin pgpcore will not be built; missing $dependencies_missing")
  1585. enable_pgpcore_plugin=no
  1586. MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS pgpcore"
  1587. else
  1588. AC_MSG_RESULT(no)
  1589. AC_MSG_ERROR("Plugin pgpcore cannot be built; missing $dependencies_missing")
  1590. fi
  1591. else
  1592. DISABLED_PLUGINS="$DISABLED_PLUGINS pgpcore"
  1593. AC_MSG_RESULT(no)
  1594. fi
  1595. AC_MSG_CHECKING([whether to build pgpmime plugin])
  1596. if test x"$enable_pgpmime_plugin" != xno; then
  1597. dependencies_missing=""
  1598. if test x"$HAVE_GPGME" = xno; then
  1599. dependencies_missing="libgpgme $dependencies_missing"
  1600. fi
  1601. if test x"$enable_pgpcore_plugin" = xno; then
  1602. dependencies_missing="pgpcore plugin $dependencies_missing"
  1603. fi
  1604. if test x"$dependencies_missing" = x; then
  1605. PLUGINS="$PLUGINS pgpmime"
  1606. AC_MSG_RESULT(yes)
  1607. elif test x"$enable_pgpmime_plugin" = xauto; then
  1608. AC_MSG_RESULT(no)
  1609. AC_MSG_WARN("Plugin pgpmime will not be built; missing $dependencies_missing")
  1610. enable_pgpmime_plugin=no
  1611. MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS pgpmime"
  1612. else
  1613. AC_MSG_RESULT(no)
  1614. AC_MSG_ERROR("Plugin pgpmime cannot be built; missing $dependencies_missing")
  1615. fi
  1616. else
  1617. DISABLED_PLUGINS="$DISABLED_PLUGINS pgpmime"
  1618. AC_MSG_RESULT(no)
  1619. fi
  1620. AC_MSG_CHECKING([whether to build pgpinline plugin])
  1621. if test x"$enable_pgpinline_plugin" != xno; then
  1622. dependencies_missing=""
  1623. if test x"$HAVE_GPGME" = xno; then
  1624. dependencies_missing="libgpgme $dependencies_missing"
  1625. fi
  1626. if test x"$enable_pgpcore_plugin" = xno; then
  1627. dependencies_missing="pgpcore plugin $dependencies_missing"
  1628. fi
  1629. if test x"$dependencies_missing" = x; then
  1630. PLUGINS="$PLUGINS pgpinline"
  1631. AC_MSG_RESULT(yes)
  1632. elif test x"$enable_pgpinline_plugin" = xauto; then
  1633. AC_MSG_RESULT(no)
  1634. AC_MSG_WARN("Plugin pgpinline will not be built; missing $dependencies_missing")
  1635. enable_pgpinline_plugin=no
  1636. MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS pgpinline"
  1637. else
  1638. AC_MSG_RESULT(no)
  1639. AC_MSG_ERROR("Plugin pgpinline cannot be built; missing $dependencies_missing")
  1640. fi
  1641. else
  1642. DISABLED_PLUGINS="$DISABLED_PLUGINS pgpinline"
  1643. AC_MSG_RESULT(no)
  1644. fi
  1645. AC_MSG_CHECKING([whether to build rssyl plugin])
  1646. if test x"$enable_rssyl_plugin" != xno; then
  1647. dependencies_missing=""
  1648. if test x"$HAVE_EXPAT" = xno; then
  1649. dependencies_missing="expat $dependencies_missing"
  1650. fi
  1651. if test x"$HAVE_CURL" = xno; then
  1652. dependencies_missing="libcurl $dependencies_missing"
  1653. fi
  1654. if test x"$dependencies_missing" = x; then
  1655. PLUGINS="$PLUGINS rssyl"
  1656. AC_MSG_RESULT(yes)
  1657. elif test x"$enable_rssyl_plugin" = xauto; then
  1658. AC_MSG_RESULT(no)
  1659. AC_MSG_WARN("Plugin rssyl will not be built; missing $dependencies_missing")
  1660. enable_rssyl_plugin=no
  1661. MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS rssyl"
  1662. else
  1663. AC_MSG_RESULT(no)
  1664. AC_MSG_ERROR("Plugin rssyl cannot be built; missing $dependencies_missing")
  1665. fi
  1666. else
  1667. DISABLED_PLUGINS="$DISABLED_PLUGINS rssyl"
  1668. AC_MSG_RESULT(no)
  1669. fi
  1670. AC_MSG_CHECKING([whether to build spamassassin plugin])
  1671. if test x"$enable_spamassassin_plugin" != xno; then
  1672. PLUGINS="$PLUGINS spamassassin"
  1673. AC_MSG_RESULT(yes)
  1674. AC_SPAMASSASSIN
  1675. dnl check for zlib (optional)
  1676. spamassassin_zlib=0
  1677. SPAMASSASSIN_CFLAGS=""
  1678. SPAMASSASSIN_LIBS=""
  1679. AC_CHECK_HEADER([zlib.h],
  1680. [AC_DEFINE(HAVE_ZLIB_H,1,[optional zlib support for spamassassin plugin])]
  1681. [spamassassin_zlib=1],
  1682. [spamassassin_zlib=0])
  1683. if test $spamassassin_zlib -eq 1; then
  1684. AC_CHECK_LIB(z, deflate, [spamassassin_zlib=1], [spamassassin_zlib=0])
  1685. AC_MSG_CHECKING([whether to build spamassassin plugin with zlib support])
  1686. if test $spamassassin_zlib -eq 1; then
  1687. AC_MSG_RESULT(yes)
  1688. SPAMASSASSIN_CFLAGS="-DHAVE_LIBZ"
  1689. SPAMASSASSIN_LIBS="-lz"
  1690. else
  1691. AC_MSG_RESULT(no)
  1692. fi
  1693. fi
  1694. AC_SUBST(SPAMASSASSIN_CFLAGS)
  1695. AC_SUBST(SPAMASSASSIN_LIBS)
  1696. else
  1697. DISABLED_PLUGINS="$DISABLED_PLUGINS spamassassin"
  1698. AC_MSG_RESULT(no)
  1699. fi
  1700. AC_MSG_CHECKING([whether to build smime plugin])
  1701. if test x"$enable_smime_plugin" != xno; then
  1702. dependencies_missing=""
  1703. if test x"$HAVE_GPGME" = xno; then
  1704. dependencies_missing="libgpgme $dependencies_missing"
  1705. fi
  1706. if test x"$enable_pgpcore_plugin" = xno; then
  1707. dependencies_missing="pgpcore plugin $dependencies_missing"
  1708. fi
  1709. if test x"$dependencies_missing" = x; then
  1710. PLUGINS="$PLUGINS smime"
  1711. AC_MSG_RESULT(yes)
  1712. elif test x"$enable_smime_plugin" = xauto; then
  1713. AC_MSG_RESULT(no)
  1714. AC_MSG_WARN("Plugin smime will not be built; missing $dependencies_missing")
  1715. enable_smime_plugin=no
  1716. MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS smime"
  1717. else
  1718. AC_MSG_RESULT(no)
  1719. AC_MSG_ERROR("Plugin smime cannot be built; missing $dependencies_missing")
  1720. fi
  1721. else
  1722. DISABLED_PLUGINS="$DISABLED_PLUGINS smime"
  1723. AC_MSG_RESULT(no)
  1724. fi
  1725. AC_MSG_CHECKING([whether to build spam_report plugin])
  1726. if test x"$enable_spam_report_plugin" != xno; then
  1727. dependencies_missing=""
  1728. if test x"$HAVE_CURL" = xno; then
  1729. dependencies_missing="libcurl $dependencies_missing"
  1730. fi
  1731. if test x"$dependencies_missing" = x; then
  1732. PLUGINS="$PLUGINS spam_report"
  1733. AC_MSG_RESULT(yes)
  1734. elif test x"$enable_spam_report_plugin" = xauto; then
  1735. AC_MSG_RESULT(no)
  1736. AC_MSG_WARN("Plugin spam_report will not be built; missing $dependencies_missing")
  1737. enable_spam_report_plugin=no
  1738. MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS spam_report"
  1739. else
  1740. AC_MSG_RESULT(no)
  1741. AC_MSG_ERROR("Plugin spam_report cannot be built; missing $dependencies_missing")
  1742. fi
  1743. else
  1744. DISABLED_PLUGINS="$DISABLED_PLUGINS spam_report"
  1745. AC_MSG_RESULT(no)
  1746. fi
  1747. AC_MSG_CHECKING([whether to build tnef_parse plugin])
  1748. if test x"$enable_tnef_parse_plugin" != xno; then
  1749. dependencies_missing=""
  1750. if test $have_ytnef -eq 0; then
  1751. dependencies_missing="libytnef"
  1752. fi
  1753. if test x"$dependencies_missing" = x; then
  1754. PLUGINS="$PLUGINS tnef_parse"
  1755. AC_MSG_RESULT(yes)
  1756. elif test x"$enable_tnef_parse_plugin" = xauto; then
  1757. AC_MSG_RESULT(no)
  1758. AC_MSG_WARN(Plugin tnef_parse will not be built; missing $dependencies_missing")
  1759. enable_tnef_parse_plugin=no
  1760. MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS tnef_parse"
  1761. else
  1762. AC_MSG_RESULT(no)
  1763. AC_MSG_ERROR(Plugin tnef_parse will not be built; missing $dependencies_missing")
  1764. fi
  1765. else
  1766. DISABLED_PLUGINS="$DISABLED_PLUGINS tnef_parse"
  1767. AC_MSG_RESULT(no)
  1768. fi
  1769. AC_MSG_CHECKING([whether to build vcalendar plugin])
  1770. if test x"$enable_vcalendar_plugin" != xno; then
  1771. dependencies_missing=""
  1772. if test x"$HAVE_CURL" = xno; then
  1773. dependencies_missing="libcurl $dependencies_missing"
  1774. fi
  1775. if test x"$HAVE_LIBICAL" = xno; then
  1776. dependencies_missing="libical $dependencies_missing"
  1777. fi
  1778. if test x"$HAVE_PERL" = xno; then
  1779. dependencies_missing="perl $dependencies_missing"
  1780. fi
  1781. if test x"$dependencies_missing" = x; then
  1782. PLUGINS="$PLUGINS vcalendar"
  1783. AC_MSG_RESULT(yes)
  1784. elif test x"$enable_vcalendar_plugin" = xauto; then
  1785. AC_MSG_RESULT(no)
  1786. AC_MSG_WARN("Plugin vcalendar will not be built; missing $dependencies_missing")
  1787. enable_vcalendar_plugin=no
  1788. MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS vcalendar"
  1789. else
  1790. AC_MSG_RESULT(no)
  1791. AC_MSG_ERROR("Plugin vcalendar cannot be built; missing $dependencies_missing")
  1792. fi
  1793. else
  1794. DISABLED_PLUGINS="$DISABLED_PLUGINS vcalendar"
  1795. AC_MSG_RESULT(no)
  1796. fi
  1797. dnl And finally the automake conditionals.
  1798. AM_CONDITIONAL(BUILD_ACPI_NOTIFIER_PLUGIN, test x"$enable_acpi_notifier_plugin" != xno)
  1799. AM_CONDITIONAL(BUILD_ADDRESS_KEEPER_PLUGIN, test x"$enable_address_keeper_plugin" != xno)
  1800. AM_CONDITIONAL(BUILD_ARCHIVE_PLUGIN, test x"$enable_archive_plugin" != xno)
  1801. AM_CONDITIONAL(BUILD_ATT_REMOVER_PLUGIN, test x"$enable_att_remover_plugin" != xno)
  1802. AM_CONDITIONAL(BUILD_ATTACHWARNER_PLUGIN, test x"$enable_attachwarner_plugin" != xno)
  1803. AM_CONDITIONAL(BUILD_BOGOFILTER_PLUGIN, test x"$enable_bogofilter_plugin" != xno)
  1804. AM_CONDITIONAL(BUILD_BSFILTER_PLUGIN, test x"$enable_bsfilter_plugin" != xno)
  1805. AM_CONDITIONAL(BUILD_CLAMD_PLUGIN, test x"$enable_clamd_plugin" != xno)
  1806. AM_CONDITIONAL(BUILD_DEMO_PLUGIN, test x"$enable_demo_plugin" != xno)
  1807. AM_CONDITIONAL(BUILD_DILLO_PLUGIN, test x"$enable_dillo_plugin" != xno)
  1808. AM_CONDITIONAL(BUILD_FANCY_PLUGIN, test x"$enable_fancy_plugin" != xno)
  1809. AM_CONDITIONAL(BUILD_FETCHINFO_PLUGIN, test x"$enable_fetchinfo_plugin" != xno)
  1810. AM_CONDITIONAL(BUILD_GDATA_PLUGIN, test x"$enable_gdata_plugin" != xno)
  1811. AM_CONDITIONAL(BUILD_LIBRAVATAR_PLUGIN, test x"$enable_libravatar_plugin" != xno)
  1812. AM_CONDITIONAL(BUILD_LITEHTML_VIEWER_PLUGIN, test x"$enable_litehtml_viewer_plugin" != xno)
  1813. AM_CONDITIONAL(BUILD_MAILMBOX_PLUGIN, test x"$enable_mailmbox_plugin" != xno)
  1814. AM_CONDITIONAL(BUILD_MANAGESIEVE_PLUGIN, test x"$enable_managesieve_plugin" != xno)
  1815. AM_CONDITIONAL(BUILD_NEWMAIL_PLUGIN, test x"$enable_newmail_plugin" != xno)
  1816. AM_CONDITIONAL(BUILD_NOTIFICATION_PLUGIN, test x"$enable_notification_plugin" != xno)
  1817. AM_CONDITIONAL(BUILD_HOTKEYS, test x"$enable_notification_plugin" != xno -a x"$HAVE_HOTKEYS" = xyes)
  1818. AM_CONDITIONAL(BUILD_PDF_VIEWER_PLUGIN, test x"$enable_pdf_viewer_plugin" != xno)
  1819. AM_CONDITIONAL(BUILD_PERL_PLUGIN, test x"$enable_perl_plugin" != xno)
  1820. AM_CONDITIONAL(BUILD_PYTHON_PLUGIN, test x"$enable_python_plugin" != xno)
  1821. AM_CONDITIONAL(BUILD_PGPCORE_PLUGIN, test x"$enable_pgpcore_plugin" != xno)
  1822. AM_CONDITIONAL(BUILD_PGPMIME_PLUGIN, test x"$enable_pgpmime_plugin" != xno)
  1823. AM_CONDITIONAL(BUILD_PGPINLINE_PLUGIN, test x"$enable_pgpinline_plugin" != xno)
  1824. AM_CONDITIONAL(BUILD_RSSYL_PLUGIN, test x"$enable_rssyl_plugin" != xno)
  1825. AM_CONDITIONAL(BUILD_SMIME_PLUGIN, test x"$enable_smime_plugin" != xno)
  1826. AM_CONDITIONAL(BUILD_SPAMASSASSIN_PLUGIN, test x"$enable_spamassassin_plugin" != xno)
  1827. AM_CONDITIONAL(BUILD_SPAM_REPORT_PLUGIN, test x"$enable_spam_report_plugin" != xno)
  1828. AM_CONDITIONAL(BUILD_TNEF_PARSE_PLUGIN, test x"$enable_tnef_parse_plugin" != xno)
  1829. AM_CONDITIONAL(BUILD_VCALENDAR_PLUGIN, test x"$enable_vcalendar_plugin" != xno)
  1830. dnl ****************************
  1831. dnl ** Final configure output **
  1832. dnl ****************************
  1833. AC_OUTPUT([
  1834. Makefile
  1835. m4/Makefile
  1836. po/Makefile.in
  1837. src/common/version.h
  1838. src/Makefile
  1839. src/common/Makefile
  1840. src/common/passcrypt.h
  1841. src/common/tests/Makefile
  1842. src/gtk/Makefile
  1843. src/etpan/Makefile
  1844. src/plugins/Makefile
  1845. src/plugins/acpi_notifier/Makefile
  1846. src/plugins/address_keeper/Makefile
  1847. src/plugins/archive/Makefile
  1848. src/plugins/att_remover/Makefile
  1849. src/plugins/attachwarner/Makefile
  1850. src/plugins/bogofilter/Makefile
  1851. src/plugins/bsfilter/Makefile
  1852. src/plugins/clamd/Makefile
  1853. src/plugins/clamd/libclamd/Makefile
  1854. src/plugins/demo/Makefile
  1855. src/plugins/dillo/Makefile
  1856. src/plugins/fancy/Makefile
  1857. src/plugins/fetchinfo/Makefile
  1858. src/plugins/gdata/Makefile
  1859. src/plugins/litehtml_viewer/Makefile
  1860. src/plugins/litehtml_viewer/litehtml/Makefile
  1861. src/plugins/libravatar/Makefile
  1862. src/plugins/mailmbox/Makefile
  1863. src/plugins/managesieve/Makefile
  1864. src/plugins/newmail/Makefile
  1865. src/plugins/notification/Makefile
  1866. src/plugins/notification/gtkhotkey/Makefile
  1867. src/plugins/pdf_viewer/Makefile
  1868. src/plugins/perl/Makefile
  1869. src/plugins/perl/tools/Makefile
  1870. src/plugins/python/Makefile
  1871. src/plugins/python/examples/Makefile
  1872. src/plugins/pgpcore/Makefile
  1873. src/plugins/pgpcore/tests/Makefile
  1874. src/plugins/pgpmime/Makefile
  1875. src/plugins/pgpinline/Makefile
  1876. src/plugins/rssyl/Makefile
  1877. src/plugins/rssyl/tests/Makefile
  1878. src/plugins/rssyl/libfeed/Makefile
  1879. src/plugins/rssyl/libfeed/tests/Makefile
  1880. src/plugins/smime/Makefile
  1881. src/plugins/spamassassin/Makefile
  1882. src/plugins/spam_report/Makefile
  1883. src/plugins/tnef_parse/Makefile
  1884. src/plugins/vcalendar/Makefile
  1885. src/tests/Makefile
  1886. doc/Makefile
  1887. doc/man/Makefile
  1888. tools/Makefile
  1889. config/Makefile
  1890. manual/Makefile
  1891. manual/dtd/Makefile
  1892. manual/dist/Makefile
  1893. manual/dist/pdf/Makefile
  1894. manual/dist/ps/Makefile
  1895. manual/dist/html/Makefile
  1896. manual/dist/txt/Makefile
  1897. manual/fr/Makefile
  1898. manual/fr/dist/Makefile
  1899. manual/fr/dist/pdf/Makefile
  1900. manual/fr/dist/ps/Makefile
  1901. manual/fr/dist/html/Makefile
  1902. manual/fr/dist/txt/Makefile
  1903. manual/es/Makefile
  1904. manual/es/dist/Makefile
  1905. manual/es/dist/pdf/Makefile
  1906. manual/es/dist/ps/Makefile
  1907. manual/es/dist/html/Makefile
  1908. manual/es/dist/txt/Makefile
  1909. claws-mail.pc
  1910. ])
  1911. dnl Output the configuration summary
  1912. echo ""
  1913. echo "$PACKAGE $VERSION"
  1914. echo ""
  1915. if test x"$enable_alternate_addressbook" = xyes; then
  1916. echo "Using Address Book : Alternate experimental interface"
  1917. else
  1918. echo "Using Address Book : Original stable interface"
  1919. echo "JPilot : $enable_jpilot"
  1920. echo "LDAP : $enable_ldap"
  1921. fi
  1922. echo "gnuTLS : $enable_gnutls"
  1923. echo "iconv : $am_cv_func_iconv"
  1924. echo "compface : $enable_compface"
  1925. echo "IPv6 : $enable_ipv6"
  1926. echo "enchant : $enable_enchant"
  1927. echo "IMAP4 : $enable_libetpan"
  1928. echo "NNTP : $enable_libetpan"
  1929. echo "Crash dialog : $enable_crash_dialog"
  1930. echo "LibSM : $enable_libsm"
  1931. echo "DBUS : $enable_dbus"
  1932. echo "NetworkManager : $enable_networkmanager"
  1933. echo "Manual : $enable_manual"
  1934. echo "Generic UMPC code : $enable_generic_umpc"
  1935. echo "SVG support : $enable_svg"
  1936. echo "Config dir : $ac_cv_with_config_dir"
  1937. echo "Password crypto : $pwd_crypto"
  1938. echo "Unit tests : $enable_tests"
  1939. echo "Plugins"
  1940. echo " Built:"
  1941. for plugin in $PLUGINS; do
  1942. echo " - $plugin"
  1943. if test x"$plugin" = xnotification; then
  1944. echo " Features:"
  1945. for notif_feature in $notification_features; do
  1946. echo " $notif_feature"
  1947. done;
  1948. if test "x$notification_missing_dependencies" != x; then
  1949. echo " Disabled due to missing dependencies:"
  1950. for notif_miss_dep in $notification_missing_dependencies; do
  1951. echo " $notif_miss_dep"
  1952. done;
  1953. fi
  1954. fi
  1955. done;
  1956. if test "x$DISABLED_PLUGINS" != x; then
  1957. echo " Disabled:"
  1958. for plugin in $DISABLED_PLUGINS; do
  1959. echo " - $plugin"
  1960. done;
  1961. fi
  1962. if test "x$MISSING_DEPS_PLUGINS" != x; then
  1963. echo " Disabled due to missing dependencies:"
  1964. for plugin in $MISSING_DEPS_PLUGINS; do
  1965. echo " - $plugin"
  1966. done;
  1967. fi
  1968. echo ""
  1969. echo "The binary will be installed in $prefix/bin"
  1970. echo ""
  1971. echo "Configure finished, type 'make' to build."