configure.ac 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169
  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. MAJOR_VERSION=3
  8. MINOR_VERSION=7
  9. MICRO_VERSION=10
  10. INTERFACE_AGE=0
  11. BINARY_AGE=0
  12. EXTRA_VERSION=16.25
  13. EXTRA_RELEASE=
  14. EXTRA_GTK2_VERSION=-new-contacts
  15. if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
  16. VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}${EXTRA_RELEASE}${EXTRA_GTK2_VERSION}
  17. else
  18. VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}cvs${EXTRA_VERSION}${EXTRA_GTK2_VERSION}
  19. fi
  20. dnl set $target
  21. AC_CANONICAL_SYSTEM
  22. dnl
  23. AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
  24. dnl AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
  25. dnl AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
  26. AC_SUBST(PACKAGE)
  27. AC_SUBST(VERSION)
  28. AC_SUBST(MAJOR_VERSION)
  29. AC_SUBST(MINOR_VERSION)
  30. AC_SUBST(MICRO_VERSION)
  31. AC_SUBST(EXTRA_VERSION)
  32. dnl GNOME installed?
  33. AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
  34. if test "$GNOME_CONFIG" != no; then
  35. gnomedatadir="`gnome-config --datadir`"
  36. gnomeprefix="`gnome-config --prefix`"
  37. if test "${prefix}" = "NONE"; then
  38. gnomedatadir="${ac_default_prefix}/${gnomedatadir#${gnomeprefix}}"
  39. else
  40. gnomedatadir="${prefix}/${gnomedatadir#${gnomeprefix}}"
  41. fi
  42. AC_SUBST(gnomedatadir)
  43. fi
  44. AM_CONDITIONAL(CLAWS_GNOME, test -n "$gnomedatadir")
  45. AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  46. if test x$PKG_CONFIG = xno ; then
  47. AC_MSG_ERROR([*** pkg-config not found. See http://www.freedesktop.org/software/pkgconfig/])
  48. fi
  49. dnl GNOME 2.x installed?
  50. PKG_CHECK_MODULES(GNOME2, libgnome-2.0 >= 2.0, ac_enable_gnome2=yes, ac_enable_gnome2=no)
  51. AM_CONDITIONAL(CLAWS_GNOME2, test x"$ac_enable_gnome2" = x"yes")
  52. dnl libtool versioning
  53. LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
  54. LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
  55. LT_REVISION=$INTERFACE_AGE
  56. LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
  57. AC_SUBST(LT_RELEASE)
  58. AC_SUBST(LT_CURRENT)
  59. AC_SUBST(LT_REVISION)
  60. AC_SUBST(LT_AGE)
  61. dnl Specify a header configuration file
  62. AC_CONFIG_HEADERS(config.h)
  63. AM_MAINTAINER_MODE
  64. dnl Checks for programs.
  65. dnl AC_ARG_PROGRAM
  66. AC_PROG_CC
  67. AC_ISC_POSIX
  68. AC_PROG_INSTALL
  69. AC_PROG_LN_S
  70. AC_PROG_MAKE_SET
  71. AC_PROG_CPP
  72. dnl AC_PROG_RANLIB
  73. AM_PROG_LEX
  74. AC_PROG_YACC
  75. AC_LIB_PREFIX
  76. AC_LIBTOOL_WIN32_DLL
  77. LT_INIT
  78. LT_AC_PROG_RC
  79. AC_LIBTOOL_RC
  80. AC_PROG_LIBTOOL
  81. AC_SYS_LARGEFILE
  82. dnl ******************************
  83. dnl Checks for host
  84. dnl Not needed anymore because we
  85. dnl do AC_CANONICAL_SYSTEM above
  86. dnl ******************************
  87. dnl AC_CANONICAL_HOST
  88. dnl Copied from the official gtk+-2 configure.in
  89. AC_MSG_CHECKING([for some Win32 platform])
  90. case "$host" in
  91. *-*-mingw*|*-*-cygwin*)
  92. platform_win32=yes
  93. LDFLAGS="$LDFLAGS -mwindows"
  94. ;;
  95. *)
  96. platform_win32=no
  97. ;;
  98. esac
  99. AC_MSG_RESULT([$platform_win32])
  100. AM_CONDITIONAL(PLATFORM_WIN32, test x"$platform_win32" = x"yes")
  101. AC_MSG_CHECKING([for native Win32])
  102. case "$host" in
  103. *-*-mingw*)
  104. os_win32=yes
  105. ;;
  106. *)
  107. os_win32=no
  108. ;;
  109. esac
  110. AC_MSG_RESULT([$os_win32])
  111. AM_CONDITIONAL(OS_WIN32, test x"$os_win32" = x"yes")
  112. AC_MSG_CHECKING([for Cygwin])
  113. case "$host" in
  114. *-*-cygwin*)
  115. env_cygwin=yes
  116. ;;
  117. *)
  118. env_cygwin=no
  119. ;;
  120. esac
  121. AC_MSG_RESULT([$env_cygwin])
  122. AM_CONDITIONAL(CYGWIN, test x"$env_cygwin" = x"yes")
  123. if test "$GCC" = "yes"
  124. then
  125. CFLAGS="$CFLAGS -Wno-unused-function"
  126. #CFLAGS="-g -Wall -Wno-unused-function"
  127. fi
  128. AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
  129. _gcc_cflags_save=$CFLAGS
  130. CFLAGS="-Wno-pointer-sign"
  131. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],_gcc_psign=yes,_gcc_psign=no)
  132. AC_MSG_RESULT($_gcc_psign)
  133. CFLAGS=$_gcc_cflags_save;
  134. if test x"$_gcc_psign" = xyes ; then
  135. CFLAGS="$CFLAGS -Wno-pointer-sign"
  136. fi
  137. CFLAGS="$CFLAGS -Wall"
  138. #if test $USE_MAINTAINER_MODE = yes; then
  139. # CFLAGS="-g -Wall -Wno-pointer-sign -DGTK_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DG_DISABLE_DEPRECATED -DGTK_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_DEPRECATED -DGSEAL_ENABLE"
  140. #fi
  141. pthread_name=
  142. case "$target" in
  143. *-darwin*)
  144. CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
  145. ;;
  146. *-*-mingw*)
  147. # Note that we need to link to pthreadGC2 in all cases. This
  148. # is because some locking is used even when pthread support is
  149. # disabled.
  150. pthread_name=pthreadGC2
  151. CFLAGS="$CFLAGS -mms-bitfields"
  152. LIBS="$LIBS -l${pthread_name} -lws2_32 -lregex"
  153. ;;
  154. *-*-solaris*)
  155. CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
  156. CFLAGS="$CFLAGS -std=gnu99 -DSOLARIS"
  157. ;;
  158. esac
  159. dnl Checks for iconv
  160. AM_ICONV
  161. dnl floor and ceil are in -lm
  162. LIBS="$LIBS -lm"
  163. dnl
  164. dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
  165. dnl
  166. syl_save_LIBS=$LIBS
  167. LIBS="$LIBS $GTK_LIBS"
  168. AC_CHECK_FUNCS(bind_textdomain_codeset)
  169. LIBS=$syl_save_LIBS
  170. dnl for gettext
  171. ALL_LINGUAS="bg ca cs de en_GB es fi fr hu id_ID it ja lt nl pl pt_BR pt_PT ru sk sv uk zh_CN"
  172. GETTEXT_PACKAGE=claws-mail
  173. AC_SUBST(GETTEXT_PACKAGE)
  174. AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define text domain.])
  175. AM_GNU_GETTEXT_VERSION([0.15])
  176. AM_GNU_GETTEXT([external])
  177. manualdir='${docdir}/manual'
  178. AC_ARG_WITH(manualdir,
  179. [ --with-manualdir=DIR Manual directory],
  180. [manualdir="$withval"])
  181. AC_SUBST(manualdir)
  182. AC_ARG_ENABLE(manual,
  183. [ --disable-manual do not build manual],
  184. [ac_cv_enable_manual=$enableval], [ac_cv_enable_manual=yes])
  185. dnl ******************************
  186. dnl ** Check for required tools **
  187. dnl ** to build manuals **
  188. dnl ******************************
  189. AC_PATH_PROG(DOCBOOK2HTML, docbook2html)
  190. AC_PATH_PROG(DOCBOOK2TXT, docbook2txt)
  191. AC_PATH_PROG(DOCBOOK2PS, docbook2ps)
  192. AC_PATH_PROG(DOCBOOK2PDF, docbook2pdf)
  193. AM_CONDITIONAL(MANUAL_HTML, test -n "$DOCBOOK2HTML")
  194. AM_CONDITIONAL(MANUAL_TXT, test -n "$DOCBOOK2TXT")
  195. AM_CONDITIONAL(MANUAL_PDF, test -n "$DOCBOOK2PDF")
  196. AM_CONDITIONAL(MANUAL_PS, test -n "$DOCBOOK2PS")
  197. if test x"$ac_cv_enable_manual" = x"yes"; then
  198. if test -n "$DOCBOOK2TXT" -o -n "$DOCBOOK2HTML" \
  199. -o -n "$DOCBOOK2PS" -o -n "$DOCBOOK2PDF"; then
  200. ac_cv_enable_manual=yes
  201. else
  202. ac_cv_enable_manual=no
  203. fi
  204. fi
  205. AM_CONDITIONAL(BUILD_MANUAL, test x"$ac_cv_enable_manual" = xyes)
  206. dnl Set PACKAGE_DATA_DIR in config.h.
  207. if test "x${datarootdir}" = 'x${prefix}/share'; then
  208. if test "x${prefix}" = "xNONE"; then
  209. AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}",[PACKAGE_DATA_DIR])
  210. else
  211. AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}",[PACKAGE_DATA_DIR])
  212. fi
  213. else
  214. AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datarootdir}/${PACKAGE}",[PACKAGE_DATA_DIR])
  215. fi
  216. AC_CHECK_LIB(xpg4, setlocale)
  217. SM_LIBS=""
  218. dnl Check for LibSM
  219. AC_ARG_ENABLE(libsm,
  220. [ --disable-libsm disable libSM support for session management.],
  221. [ac_cv_enable_libsm=$enableval], [ac_cv_enable_libsm=yes])
  222. AC_MSG_CHECKING([whether to use LibSM])
  223. if test x"$ac_cv_enable_libsm" = xyes; then
  224. AC_MSG_RESULT(yes)
  225. AC_CHECK_LIB(SM, SmcSaveYourselfDone,
  226. [SM_LIBS="$X_LIBS -lSM -lICE"],ac_cv_enable_libsm=no,
  227. $X_LIBS -lICE)
  228. AC_CHECK_HEADERS(X11/SM/SMlib.h,,ac_cv_enable_libsm=no)
  229. if test x"$ac_cv_enable_libsm" = xyes; then
  230. AC_DEFINE(HAVE_LIBSM, 1, [Define to 1 if you have libSM installed])
  231. else
  232. AC_MSG_RESULT(not found)
  233. AC_MSG_WARN([*** LibSM will not be supported ***])
  234. fi
  235. else
  236. AC_MSG_RESULT(no)
  237. fi
  238. AC_SUBST(SM_LIBS)
  239. dnl for GThread support (currently disabled)
  240. dnl AC_ARG_ENABLE(threads,
  241. dnl [ --enable-threads Enable multithread support [default=no]],
  242. dnl [use_threads=$enableval], [use_threads=no])
  243. AC_MSG_CHECKING([whether to use threads])
  244. if test x"$use_threads" = xyes ; then
  245. AC_MSG_RESULT(yes)
  246. if test ! -z `$GLIB_CONFIG --help 2>&1 |grep 'gthread'` ; then
  247. CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
  248. LIBS="$LIBS `$GLIB_CONFIG --libs gthread`"
  249. AC_DEFINE(USE_THREADS, 1, Whether to use multithread or not)
  250. else
  251. AC_MSG_ERROR([Claws Mail requires GThread from GLib to use threading.])
  252. fi
  253. else
  254. AC_MSG_RESULT(no)
  255. fi
  256. dnl Check for d_type member in struct dirent
  257. AC_MSG_CHECKING([whether struct dirent has d_type member])
  258. AC_CACHE_VAL(ac_cv_dirent_d_type,[
  259. AC_TRY_COMPILE([#include <dirent.h>],
  260. [struct dirent d; d.d_type = DT_REG;],
  261. ac_cv_dirent_d_type=yes, ac_cv_dirent_d_type=no)
  262. ])
  263. AC_MSG_RESULT($ac_cv_dirent_d_type)
  264. if test $ac_cv_dirent_d_type = yes; then
  265. AC_DEFINE(HAVE_DIRENT_D_TYPE, 1,
  266. Define if `struct dirent' has `d_type' member.)
  267. fi
  268. # Check whether mkdir does not take the permission argument.
  269. GNUPG_FUNC_MKDIR_TAKES_ONE_ARG
  270. dnl Checks for header files.
  271. AC_HEADER_DIRENT
  272. AC_HEADER_STDC
  273. AC_HEADER_SYS_WAIT
  274. AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
  275. sys/param.h sys/utsname.h sys/select.h \
  276. wchar.h wctype.h locale.h netdb.h)
  277. AC_CHECK_HEADER([execinfo.h], [AC_DEFINE(HAVE_BACKTRACE,1,[Has backtrace*() needed for retrieving stack traces])])
  278. AC_SEARCH_LIBS(backtrace_symbols, [execinfo])
  279. dnl alf - Check for apache installation f*ck up. apache may also install an
  280. dnl fnmatch, which includes their own regex stuff if USE_HSREGEX is defined
  281. AC_TRY_COMPILE([#include <stdlib.h>
  282. #include <fnmatch.h>],
  283. [int x = USE_HSREGEX;],
  284. ac_cv_have_apache_fnmatch=yes, ac_cv_have_apache_fnmatch=no)
  285. if test $ac_cv_have_apache_fnmatch = yes; then
  286. AC_DEFINE(HAVE_APACHE_FNMATCH, 1, Define if you need to work around apache regex/fnmatch !KLUDGE!)
  287. fi
  288. AC_MSG_CHECKING([whether to use Apache regex header kludge])
  289. AC_MSG_RESULT($ac_cv_have_apache_fnmatch)
  290. dnl Checks for typedefs, structures, and compiler characteristics.
  291. AC_C_CONST
  292. AC_TYPE_OFF_T
  293. AC_TYPE_PID_T
  294. AC_TYPE_SIZE_T
  295. AC_STRUCT_TM
  296. dnl AC_CHECK_TYPE(wint_t, unsigned int) does not work because wint_t
  297. dnl may be defined only in wchar.h (this happens with gcc-2.96).
  298. dnl So we need to use this extended macro.
  299. CLAWS_CHECK_TYPE(wint_t, unsigned int,
  300. [
  301. #if HAVE_WCHAR_H
  302. #include <wchar.h>
  303. #endif
  304. ], Define to `unsigned int' if <stddef.h> or <wchar.h> doesn't define.)
  305. GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF, Used to test for a u32 typedef)
  306. AC_CHECK_SIZEOF(unsigned short, 2)
  307. AC_CHECK_SIZEOF(unsigned int, 4)
  308. AC_CHECK_SIZEOF(unsigned long, 4)
  309. dnl Checks for library functions.
  310. AC_FUNC_ALLOCA
  311. AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr strchr \
  312. uname flock lockf inet_aton inet_addr \
  313. fchmod mkstemp truncate getuid regcomp)
  314. AC_CHECK_FUNCS(fgets_unlocked fwrite_unlocked)
  315. dnl *****************
  316. dnl ** common code **
  317. dnl *****************
  318. dnl check for glib
  319. PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.6 gmodule-2.0 >= 2.6 gobject-2.0 >= 2.6 gthread-2.0 >= 2.6)
  320. GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
  321. AC_SUBST(GLIB_GENMARSHAL)
  322. AC_SUBST(GLIB_CFLAGS)
  323. AC_SUBST(GLIB_LIBS)
  324. dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
  325. syl_save_LIBS=$LIBS
  326. LIBS="$LIBS $GTK_LIBS"
  327. AC_CHECK_FUNCS(bind_textdomain_codeset)
  328. LIBS=$syl_save_LIBS
  329. dnl check for IPv6 option
  330. AC_ARG_ENABLE(ipv6,
  331. [ --disable-ipv6 disable build IPv6 support],
  332. [ac_cv_enable_ipv6=$enableval], [ac_cv_enable_ipv6=yes])
  333. dnl automated checks for IPv6 support.
  334. AC_MSG_CHECKING([whether to use IPv6])
  335. if test x"$ac_cv_enable_ipv6" = xyes; then
  336. AC_MSG_RESULT(yes)
  337. AC_MSG_CHECKING([for IPv6 support])
  338. AC_CACHE_VAL(ac_cv_ipv6,[
  339. AC_TRY_COMPILE([#define INET6
  340. #include <sys/types.h>
  341. #include <netinet/in.h>],
  342. [int x = IPPROTO_IPV6; struct in6_addr a;],
  343. ac_cv_ipv6=yes, ac_cv_ipv6=no)
  344. ])
  345. AC_MSG_RESULT($ac_cv_ipv6)
  346. if test $ac_cv_ipv6 = yes; then
  347. AC_DEFINE(INET6, 1, Define if you want IPv6 support.)
  348. else
  349. AC_MSG_WARN(*** IPv6 will not be supported ***)
  350. ac_cv_enable_ipv6=no
  351. fi
  352. else
  353. AC_MSG_RESULT(no)
  354. fi
  355. dnl GNUTLS
  356. AC_MSG_CHECKING([whether to use GnuTLS])
  357. AC_ARG_ENABLE(gnutls, [ --enable-gnutls enable GnuTLS support],
  358. [ac_cv_enable_gnutls=$enableval], [ac_cv_enable_gnutls=yes])
  359. AC_MSG_RESULT($ac_cv_enable_gnutls)
  360. if test "x$ac_cv_enable_gnutls" != "xno"; then
  361. PKG_CHECK_MODULES(GNUTLS, gnutls >= 2.2,
  362. [
  363. AC_DEFINE(USE_GNUTLS, 1, gnutls)
  364. echo "Building with GnuTLS"
  365. ],
  366. [
  367. echo "Building without gnutls"
  368. ])
  369. PKG_CHECK_MODULES(GNUTLS, gnutls >= 2.11,
  370. [
  371. dnl No linking against libgcrypt needed
  372. ],
  373. [
  374. dnl linking against libgcrypt *is* needed
  375. GNUTLS_LIBS="$GNUTLS_LIBS -lgcrypt"
  376. ])
  377. AC_SUBST(GNUTLS_LIBS)
  378. AC_SUBST(GNUTLS_CFLAGS)
  379. fi
  380. dnl password encryption
  381. OLDLIBS=$LIBS
  382. LIBS=
  383. case $host_os in
  384. *dragonfly*)
  385. AC_SEARCH_LIBS(encrypt, cipher, [], AC_MSG_ERROR(['encrypt'-function not found.]))
  386. ;;
  387. *)
  388. AC_SEARCH_LIBS(encrypt, crypt, [], AC_MSG_ERROR(['encrypt'-function not found.]))
  389. ;;
  390. esac
  391. CRYPT_LIBS=$LIBS
  392. AC_SUBST(CRYPT_LIBS)
  393. LIBS=$OLDLIBS
  394. AC_ARG_WITH(passcrypt-key, [ --with-passcrypt-key=KEY Key used to encode passwords (8 byte string)],
  395. with_passcrypt_key="$withval", with_passcrypt_key="passkey0")
  396. AC_SUBST(PASSCRYPT_KEY, $with_passcrypt_key)
  397. dnl RC dir (will be default at a certain point in time)
  398. AC_ARG_WITH(config-dir, [ --with-config-dir=RCDIR Local configuration dir (default: .claws-mail)],
  399. ac_cv_with_config_dir="$withval", ac_cv_with_config_dir=".claws-mail")
  400. if test x"$ac_cv_with_config_dir" = x""; then
  401. ac_cv_with_config_dir=".claws-mail"
  402. fi
  403. AC_DEFINE_UNQUOTED(CFG_RC_DIR, "$ac_cv_with_config_dir", Configuration directory)
  404. dnl ************************
  405. dnl ** GTK user interface **
  406. dnl ************************
  407. dnl Checks for GTK
  408. AC_ARG_ENABLE(gtk3,
  409. AS_HELP_STRING([--enable-gtk3],
  410. [Determines whether to use Gtk+ 3.0.]),
  411. [ac_cv_enable_gtk3=$enableval],[ac_cv_enable_gtk3=no])
  412. AM_CONDITIONAL(GTK3, false)
  413. AM_CONDITIONAL(GTK2, true)
  414. if test x"$ac_cv_enable_gtk3" = x"yes"; then
  415. PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 3.0 cairo)
  416. AM_CONDITIONAL(GTK3, true)
  417. AM_CONDITIONAL(GTK2, false)
  418. else
  419. PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.18)
  420. dnl --disable-deprecated switch for GTK2 purification
  421. AC_ARG_ENABLE(deprecated, [ --disable-deprecated disable deprecated GTK functions. ],
  422. [GTK_CFLAGS="$GTK_CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"], [])
  423. fi
  424. AC_SUBST(GTK_CFLAGS)
  425. AC_SUBST(GTK_LIBS)
  426. dnl enchant is used for spell checking
  427. AC_MSG_CHECKING([whether to use enchant])
  428. AC_ARG_ENABLE(enchant,
  429. [ --disable-enchant disable enchant support],
  430. [ac_cv_enable_enchant=$enableval], [ac_cv_enable_enchant=yes])
  431. AC_MSG_RESULT($ac_cv_enable_enchant)
  432. if test $ac_cv_enable_enchant = yes; then
  433. PKG_CHECK_MODULES(ENCHANT, enchant >= 1.0.0,
  434. [
  435. AC_DEFINE(USE_ENCHANT, 1, enchant)
  436. echo "Building with enchant"
  437. ac_cv_enable_enchant=yes
  438. CFLAGS="$CFLAGS `$PKG_CONFIG --cflags enchant`"
  439. ],
  440. [
  441. echo "Building without enchant-notification"
  442. ac_cv_enable_enchant=no
  443. ])
  444. AC_SUBST(ENCHANT_CFLAGS)
  445. AC_SUBST(ENCHANT_LIBS)
  446. fi
  447. dnl want crash dialog
  448. AC_ARG_ENABLE(crash-dialog,
  449. [ --enable-crash-dialog Enable crash dialog [default=no]],
  450. [ac_cv_enable_crash_dialog=$enableval], [ac_cv_enable_crash_dialog=no])
  451. if test $ac_cv_enable_crash_dialog = yes; then
  452. dnl check if GDB is somewhere
  453. AC_CHECK_PROG(ac_cv_enable_crash_dialog, gdb, yes, no)
  454. AC_MSG_CHECKING([whether to use crash dialog])
  455. if test $ac_cv_enable_crash_dialog = yes; then
  456. AC_DEFINE(CRASH_DIALOG, 1, Pop up crash dialog)
  457. fi
  458. AC_MSG_RESULT($ac_cv_enable_crash_dialog)
  459. fi
  460. dnl generic umpc
  461. AC_ARG_ENABLE(generic-umpc,
  462. [ --enable-generic-umpc Enable generic UMPC code [default=no]],
  463. [ac_cv_enable_generic_umpc=$enableval], [ac_cv_enable_generic_umpc=no])
  464. if test $ac_cv_enable_generic_umpc = yes; then
  465. AC_DEFINE(GENERIC_UMPC, 1, Generic UMPC code)
  466. AC_MSG_RESULT($ac_cv_enable_generic_umpc)
  467. fi
  468. dnl Maemo platform
  469. AC_ARG_ENABLE(maemo,
  470. [ --enable-maemo build for the Maemo platform [default=no]],
  471. [ac_cv_enable_maemo=$enableval], [ac_cv_enable_maemo=no])
  472. if test $ac_cv_enable_maemo = yes; then
  473. PKG_CHECK_MODULES(MAEMO, libosso hildon-libs hildon-fm gnome-vfs-2.0, ac_cv_enable_maemo=yes,
  474. ac_cv_enable_maemo=no)
  475. AC_SUBST(MAEMO_CFLAGS)
  476. AC_SUBST(MAEMO_LIBS)
  477. if test $ac_cv_enable_maemo = no; then
  478. #test for chinook
  479. PKG_CHECK_MODULES(MAEMO, libosso hildon-1 hildon-fm-2 gnome-vfs-2.0 hal, ac_cv_enable_maemo=yes,
  480. ac_cv_enable_maemo=no)
  481. AC_SUBST(MAEMO_CFLAGS)
  482. AC_SUBST(MAEMO_LIBS)
  483. if test $ac_cv_enable_maemo = no; then
  484. AC_MSG_ERROR(one of libosso hildon-libs hildon-fm hildon-1 hildon-fm-2 not found)
  485. else
  486. AC_DEFINE(MAEMO, 1, Build for maemo)
  487. AC_DEFINE(CHINOOK, 1, Maemo chinook)
  488. AC_DEFINE(GENERIC_UMPC, 1, Generic UMPC code)
  489. ac_cv_enable_generic_umpc=yes
  490. fi
  491. else
  492. AC_DEFINE(MAEMO, 1, Build for maemo)
  493. AC_DEFINE(GENERIC_UMPC, 1, Generic UMPC code)
  494. ac_cv_enable_generic_umpc=yes
  495. fi
  496. fi
  497. PKG_CHECK_MODULES(CONIC, conic, ac_cv_enable_conic=yes,
  498. ac_cv_enable_conic=no)
  499. AC_SUBST(CONIC_CFLAGS)
  500. AC_SUBST(CONIC_LIBS)
  501. if test $ac_cv_enable_conic = yes; then
  502. AC_DEFINE(CONIC, 1, Have conic lib)
  503. fi
  504. dnl Check for X-Face support
  505. AC_ARG_ENABLE(compface,
  506. [ --disable-compface disable compface (X-Face) support],
  507. [ac_cv_enable_compface=$enableval], [ac_cv_enable_compface=yes])
  508. AC_MSG_CHECKING([whether to use compface])
  509. if test x"$ac_cv_enable_compface" = xyes; then
  510. AC_MSG_RESULT(yes)
  511. AC_CHECK_LIB(compface, uncompface,
  512. [AC_DEFINE(HAVE_LIBCOMPFACE, 1, Define if you want compface support.)],
  513. [ac_cv_enable_compface=no])
  514. if test x"$ac_cv_enable_compface" = xyes; then
  515. COMPFACE_LIBS="-lcompface"
  516. else
  517. COMPFACE_LIBS=""
  518. fi
  519. AC_SUBST(COMPFACE_LIBS)
  520. else
  521. AC_MSG_RESULT(no)
  522. fi
  523. dnl check for pthread support
  524. AC_ARG_ENABLE(pthread,
  525. [ --disable-pthread disable pthread support],
  526. [ac_cv_enable_pthread=$enableval], [ac_cv_enable_pthread=yes])
  527. AC_MSG_CHECKING([whether to use pthread])
  528. if test x$ac_cv_enable_pthread = xno; then
  529. AC_MSG_RESULT(no)
  530. else
  531. AC_MSG_RESULT(yes)
  532. # For W32 we need to use a special ptrhead lib. In this case we can't
  533. # use AC_CHECK_LIB because it has no means of checking for a
  534. # library installed under a different name. Checking for the
  535. # header is okay.
  536. if test -n "${pthread_name}" ; then
  537. ac_cv_enable_pthread=yes
  538. else
  539. AC_CHECK_LIB(pthread, pthread_create, :, ac_cv_enable_pthread=no)
  540. fi
  541. AC_CHECK_HEADERS(pthread.h, :, ac_cv_enable_pthread=no)
  542. if test x$ac_cv_enable_pthread = xyes; then
  543. AC_DEFINE(USE_PTHREAD, 1, Define if you have pthread)
  544. if test -z "${pthread_name}" ; then
  545. PTHREAD_LIBS="-lpthread"
  546. fi
  547. fi
  548. fi
  549. AC_SUBST(PTHREAD_LIBS)
  550. dnl
  551. dnl Check whether we need to pass -lresolv
  552. dnl We know that we don't need it for W32.
  553. dnl
  554. if test x$os_win32 = xno; then
  555. t_oldLibs="$LIBS"
  556. LIBS="$LIBS"
  557. ac_cv_var__res_options=no
  558. AC_TRY_LINK([#include <sys/types.h>
  559. #include <sys/socket.h>
  560. #include <netinet/in.h>
  561. #include <arpa/nameser.h>
  562. #include <resolv.h>],
  563. [_res.options = RES_INIT;],
  564. ac_cv_var__res_options=yes);
  565. if test "$ac_cv_var__res_options" != "yes"; then
  566. LIBRESOLV="-lresolv"
  567. fi
  568. LIBS="$t_oldLibs"
  569. if test "x$LIBRESOLV" = "x"; then
  570. AC_CHECK_LIB(resolv, res_query, [LIBRESOLV=-lresolv])
  571. LIBS="$t_oldLibs"
  572. fi
  573. fi
  574. AC_SUBST(LIBRESOLV)
  575. LIBS="$LIBS $LIBRESOLV"
  576. dnl #######################################################################
  577. dnl # Check for startup notification
  578. dnl #######################################################################
  579. AC_ARG_ENABLE(startup-notification, [ --disable-startup-notification disable startup notification support],,enable_startup_notification=yes)
  580. if test "x$enable_startup_notification" = "xyes"; then
  581. PKG_CHECK_MODULES(STARTUP_NOTIFICATION, libstartup-notification-1.0 >= 0.5,
  582. [
  583. AC_DEFINE(HAVE_STARTUP_NOTIFICATION, 1, [Define if we're using libstartup-notification.])
  584. echo "Building with libstartup-notification"
  585. enable_startup_notification=yes
  586. ],
  587. [
  588. echo "Building without libstartup-notification"
  589. enable_startup_notification=no
  590. ])
  591. AC_SUBST(STARTUP_NOTIFICATION_CFLAGS)
  592. AC_SUBST(STARTUP_NOTIFICATION_LIBS)
  593. fi
  594. dnl #######################################################################
  595. dnl # Check for D-Bus support
  596. dnl #######################################################################
  597. AC_ARG_ENABLE(dbus, [ --disable-dbus disable dbus support],,enable_dbus=yes)
  598. if test "x$enable_dbus" = "xyes"; then
  599. PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.60, dbus-glib-1 >= 0.60],
  600. [
  601. AC_DEFINE(HAVE_DBUS_GLIB, 1, [Define if glib bindings of D-Bus are available])
  602. enable_dbus_glib=yes
  603. ],
  604. [
  605. echo "D-Bus requirements not met. D-Bus support not activated."
  606. enable_dbus_glib=no
  607. ])
  608. AC_SUBST(DBUS_CFLAGS)
  609. AC_SUBST(DBUS_LIBS)
  610. fi
  611. dnl #######################################################################
  612. dnl # Configure address book support
  613. dnl #######################################################################
  614. dnl #######################################################################
  615. dnl # Check for new address book support
  616. dnl #######################################################################
  617. AC_MSG_CHECKING([whether DBUS support for new address book is present])
  618. if test x"$enable_dbus_glib" = xyes; then
  619. AC_MSG_RESULT([yes])
  620. AC_MSG_CHECKING([whether to enable new address book])
  621. AC_ARG_ENABLE(new-addrbook, [ --enable-new-addrbook enable new address book],,enable_new_addrbook=no)
  622. if test x"$enable_new_addrbook" = xyes; then
  623. AC_MSG_RESULT([yes])
  624. PKG_CHECK_MODULES(CONTACTS, [claws-contacts],
  625. [
  626. AC_DEFINE(USE_NEW_ADDRBOOK, 1, [Define if new address book is to be activated.])
  627. enable_new_addrbook=yes
  628. AC_SUBST(CONTACTS_CFLAGS)
  629. AC_SUBST(CONTACTS_LIBS)
  630. ],
  631. [
  632. enable_new_addrbook=no
  633. ])
  634. else
  635. AC_MSG_RESULT([no])
  636. enable_new_addrbook=no
  637. fi
  638. else
  639. AC_MSG_RESULT([no])
  640. enable_new_addrbook=no
  641. fi
  642. dnl #######################################################################
  643. dnl # Check for old address book support
  644. dnl #######################################################################
  645. if test x"$enable_new_addrbook" = xno; then
  646. dnl for LDAP support in addressbook
  647. dnl no check for libraries; dynamically loaded
  648. AC_ARG_ENABLE(ldap,
  649. [ --disable-ldap disable LDAP support],
  650. [ac_cv_enable_ldap=$enableval], [ac_cv_enable_ldap=yes])
  651. AC_MSG_CHECKING([whether to use LDAP])
  652. if test x"$ac_cv_enable_ldap" = xno; then
  653. AC_MSG_RESULT(no)
  654. elif test x"$ac_cv_enable_ldap" = xyes -a x"$ac_cv_enable_pthread" = xno; then
  655. AC_MSG_RESULT(no - LDAP support needs pthread support)
  656. ac_cv_enable_ldap=no
  657. elif test x"$platform_win32" = xyes; then
  658. AC_MSG_RESULT(yes)
  659. AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
  660. LDAP_LIBS="-lwldap32"
  661. AC_SUBST(LDAP_LIBS)
  662. else
  663. AC_MSG_RESULT(yes)
  664. dnl check for available libraries, and pull them in
  665. AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="$LDAP_LIBS -lresolv")
  666. AC_CHECK_LIB(socket, bind, LDAP_LIBS="$LDAP_LIBS -lsocket")
  667. AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl")
  668. AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS="$LDAP_LIBS -llber",,
  669. $LDAP_LIBS)
  670. AC_CHECK_HEADERS(ldap.h lber.h,
  671. [ ac_cv_enable_ldap=yes ],
  672. [ ac_cv_enable_ldap=no ])
  673. if test "$ac_cv_enable_ldap" = yes; then
  674. AC_CHECK_LIB(ldap, ldap_open,
  675. [ ac_cv_enable_ldap=yes ],
  676. [ ac_cv_enable_ldap=no ],
  677. $LDAP_LIBS)
  678. AC_CHECK_LIB(ldap, ldap_start_tls_s,
  679. [ ac_cv_have_tls=yes ],
  680. [ ac_cv_have_tls=no ])
  681. fi
  682. AC_MSG_CHECKING([whether ldap library is available])
  683. AC_MSG_RESULT($ac_cv_enable_ldap)
  684. AC_MSG_CHECKING([whether TLS library is available])
  685. AC_MSG_RESULT($ac_cv_have_tls)
  686. if test "$ac_cv_enable_ldap" = yes; then
  687. AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
  688. LDAP_LIBS="$LDAP_LIBS -lldap"
  689. AC_SUBST(LDAP_LIBS)
  690. if test "$ac_cv_have_tls" = yes; then
  691. AC_DEFINE(USE_LDAP_TLS, 1, Define if you want LDAP TLS support in addressbook.)
  692. fi
  693. dnl As of OpenLDAP API version 3000 a number of functions has
  694. dnl been deprecated. As Claws-mail compiles and runs on many
  695. dnl platforms and many versions of OpenLDAP we need to be able
  696. dnl to switch between the old and new API because new API has
  697. dnl added new functions replacing old ones and at the same time
  698. dnl old functions has been changed.
  699. dnl If cross-compiling defaults to enable deprecated features
  700. dnl for maximum portability
  701. AC_MSG_CHECKING([The API version of OpenLDAP])
  702. AC_RUN_IFELSE(
  703. [AC_LANG_PROGRAM(
  704. [#include <ldap.h>],
  705. [if (LDAP_API_VERSION >= 3000)
  706. return 1
  707. ])],
  708. [AC_MSG_RESULT([version < 3000])
  709. AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 0, Define if OpenLDAP API is at least version 3000.)],
  710. [AC_MSG_RESULT([version >= 3000])
  711. AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 1, Define if OpenLDAP API is at least version 3000.)],
  712. [AC_MSG_RESULT([Enabling deprecated features in OpenLDAP])
  713. AC_DEFINE(OPEN_LDAP_API_AT_LEAST_3000, 0, Define if OpenLDAP API is at least version 3000.)
  714. AC_DEFINE(LDAP_DEPRECATED, 1, Define to activate deprecated features in OpenLDAP)]
  715. )
  716. fi
  717. fi
  718. dnl for JPilot support in addressbook
  719. dnl no check for libraries; these are dynamically loaded
  720. AC_ARG_ENABLE(jpilot,
  721. [ --disable-jpilot disable JPilot support],
  722. [ac_cv_enable_jpilot=$enableval], [ac_cv_enable_jpilot=yes])
  723. AC_MSG_CHECKING([whether to use JPilot])
  724. if test "$ac_cv_enable_jpilot" = yes; then
  725. AC_MSG_RESULT(yes)
  726. AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h pi-version.h,
  727. [ AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ],
  728. [ ac_cv_enable_jpilot=no ])
  729. if test "$ac_cv_enable_jpilot" = no; then
  730. AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h libpisock/pi-version.h,
  731. [ ac_cv_enable_jpilot=yes
  732. AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ])
  733. fi
  734. AC_CHECK_LIB(pisock, unpack_Address, [JPILOT_LIBS="-lpisock"], [JPILOT_LIBS="" ac_cv_enable_jpilot="no"])
  735. if test x"$ac_cv_enable_jpilot" = xyes; then
  736. AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.)
  737. else
  738. AC_MSG_NOTICE([JPilot support not available])
  739. fi
  740. AC_SUBST(JPILOT_LIBS)
  741. else
  742. AC_MSG_RESULT(no)
  743. fi
  744. fi
  745. AM_CONDITIONAL(BUILD_NEWADDRBOOK, test x"$enable_new_addrbook" = x"yes")
  746. dnl #######################################################################
  747. dnl # Check for NetworkManager support
  748. dnl #######################################################################
  749. if test x"$enable_dbus_glib" = xyes; then
  750. AC_ARG_ENABLE(networkmanager-support, [ --disable-networkmanager-support disable NetworkManager support],,enable_networkmanager_support=yes)
  751. if test x"$enable_networkmanager_support" = xyes; then
  752. PKG_CHECK_MODULES(NETWORKMANAGER_SUPPORT, NetworkManager >= 0.6.2,
  753. [
  754. AC_DEFINE(HAVE_NETWORKMANAGER_SUPPORT, 1, [Define if NetworkManager support is to be included.])
  755. echo "Building with NetworkManager support"
  756. enable_networkmanager_support=yes
  757. ],
  758. [
  759. echo "NetworkManager not found."
  760. enable_networkmanager_support=no
  761. ])
  762. AC_SUBST(NETWORKMANAGER_SUPPORT_CFLAGS)
  763. fi
  764. else
  765. echo "NetworkManager support deactivated as D-Bus requirements were not met."
  766. enable_networkmanager_support=no
  767. fi
  768. dnl *************************
  769. dnl ** section for plugins **
  770. dnl *************************
  771. PLUGINS=""
  772. dnl --- Trayicon ---
  773. AC_MSG_CHECKING([whether to build Trayicon plugin])
  774. AC_ARG_ENABLE(trayicon-plugin,
  775. [ --disable-trayicon-plugin do not build System Tray Icon plugin],
  776. [ac_cv_enable_trayicon_plugin=$enableval], [ac_cv_enable_trayicon_plugin=yes])
  777. if test x"$ac_cv_enable_trayicon_plugin" = xyes; then
  778. AC_MSG_RESULT(yes)
  779. PLUGINS="trayicon $PLUGINS"
  780. else
  781. AC_MSG_RESULT(no)
  782. fi
  783. AM_CONDITIONAL(BUILD_TRAYICON_PLUGIN, test x"$ac_cv_enable_trayicon_plugin" = xyes)
  784. dnl --- SpamAssassin ---
  785. AC_MSG_CHECKING([whether to build SpamAssassin plugin])
  786. AC_ARG_ENABLE(spamassassin-plugin,
  787. [ --disable-spamassassin-plugin do not build SpamAssassin plugin],
  788. [ac_cv_enable_spamassassin_plugin=$enableval], [ac_cv_enable_spamassassin_plugin=yes])
  789. if test x"$ac_cv_enable_spamassassin_plugin" = xyes; then
  790. AC_MSG_RESULT(yes)
  791. AC_SPAMASSASSIN
  792. PLUGINS="spamassassin $PLUGINS"
  793. AC_DEFINE(USE_SPAMASSASSIN_PLUGIN, 1, Define if spamassassin plugin is being built.)
  794. else
  795. AC_MSG_RESULT(no)
  796. fi
  797. AM_CONDITIONAL(BUILD_SPAMASSASSIN_PLUGIN, test x"$ac_cv_enable_spamassassin_plugin" = xyes)
  798. dnl --- Bogofilter ---
  799. AC_MSG_CHECKING([whether to build Bogofilter plugin])
  800. AC_ARG_ENABLE(bogofilter-plugin,
  801. [ --disable-bogofilter-plugin do not build bogofilter plugin],
  802. [ac_cv_enable_bogofilter_plugin=$enableval], [ac_cv_enable_bogofilter_plugin=yes])
  803. if test x"$ac_cv_enable_bogofilter_plugin" = xyes; then
  804. AC_MSG_RESULT(yes)
  805. PLUGINS="bogofilter $PLUGINS"
  806. AC_DEFINE(USE_BOGOFILTER_PLUGIN, 1, Define if bogofilter plugin is being built.)
  807. else
  808. AC_MSG_RESULT(no)
  809. fi
  810. AM_CONDITIONAL(BUILD_BOGOFILTER_PLUGIN, test x"$ac_cv_enable_bogofilter_plugin" = xyes)
  811. dnl --- PGP/CORE ---
  812. AC_MSG_CHECKING([whether to build PGP/CORE plugin])
  813. AC_ARG_ENABLE(pgpcore-plugin,
  814. [ --disable-pgpcore-plugin do not build PGP/Core plugin],
  815. [ac_cv_enable_pgpcore_plugin=$enableval], [ac_cv_enable_pgpcore_plugin=yes])
  816. if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
  817. AC_MSG_RESULT(yes)
  818. AM_PATH_GPGME(1.0.0, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.),
  819. [ac_cv_enable_pgpcore_plugin=no])
  820. if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
  821. PLUGINS="pgpcore $PLUGINS"
  822. AM_PATH_GPGME(1.1.1,
  823. AC_DEFINE(HAVE_GPGME_PKA_TRUST, 1,
  824. [Define if GPGME supports PKA.]))
  825. #needed to get GPGME_LIBS and al correctly
  826. AM_PATH_GPGME(1.0.0, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.),
  827. [ac_cv_enable_pgpcore_plugin=no])
  828. else
  829. AC_MSG_WARN([*** PGP/CORE plugin will not be built ***])
  830. fi
  831. else
  832. AC_MSG_RESULT(no)
  833. fi
  834. AM_CONDITIONAL(BUILD_PGPCORE_PLUGIN, test x"$ac_cv_enable_pgpcore_plugin" = xyes)
  835. AC_MSG_CHECKING([whether to build PGP/MIME plugin])
  836. AC_ARG_ENABLE(pgpmime-plugin,
  837. [ --disable-pgpmime-plugin do not build PGP/MIME plugin],
  838. [ac_cv_enable_pgpmime_plugin=$enableval], [ac_cv_enable_pgpmime_plugin=yes])
  839. if test x"$ac_cv_enable_pgpmime_plugin" = xyes; then
  840. AC_MSG_RESULT(yes)
  841. if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
  842. PLUGINS="pgpmime $PLUGINS"
  843. else
  844. AC_MSG_WARN([*** PGP/MIME plugin cannot be built ***])
  845. AC_MSG_WARN([*** without the PGP/CORE plugin ***])
  846. fi
  847. else
  848. AC_MSG_RESULT(no)
  849. fi
  850. AM_CONDITIONAL(BUILD_PGPMIME_PLUGIN, test x"$ac_cv_enable_pgpmime_plugin" = xyes)
  851. AC_MSG_CHECKING([whether to build PGP/Inline plugin])
  852. AC_ARG_ENABLE(pgpinline-plugin,
  853. [ --disable-pgpinline-plugin do not build PGP/Inline plugin],
  854. [ac_cv_enable_pgpinline_plugin=$enableval], [ac_cv_enable_pgpinline_plugin=yes])
  855. if test x"$ac_cv_enable_pgpinline_plugin" = xyes; then
  856. AC_MSG_RESULT(yes)
  857. if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
  858. PLUGINS="pgpinline $PLUGINS"
  859. else
  860. AC_MSG_WARN([*** PGP/Inline plugin cannot be built ***])
  861. AC_MSG_WARN([*** without the PGP/CORE plugin ***])
  862. fi
  863. else
  864. AC_MSG_RESULT(no)
  865. fi
  866. AM_CONDITIONAL(BUILD_PGPINLINE_PLUGIN, test x"$ac_cv_enable_pgpinline_plugin" = xyes)
  867. AC_MSG_CHECKING([whether to build S/Mime plugin])
  868. AC_ARG_ENABLE(smime-plugin,
  869. [ --disable-smime-plugin do not build S/Mime plugin],
  870. [ac_cv_enable_smime_plugin=$enableval], [ac_cv_enable_smime_plugin=yes])
  871. if test x"$ac_cv_enable_smime_plugin" = xyes; then
  872. AC_MSG_RESULT(yes)
  873. if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
  874. PLUGINS="smime $PLUGINS"
  875. else
  876. AC_MSG_WARN([*** S/Mime plugin cannot be built ***])
  877. AC_MSG_WARN([*** without the PGP/CORE plugin ***])
  878. fi
  879. else
  880. AC_MSG_RESULT(no)
  881. fi
  882. AM_CONDITIONAL(BUILD_SMIME_PLUGIN, test x"$ac_cv_enable_smime_plugin" = xyes)
  883. dnl --- Dillo Viewer ---
  884. AC_MSG_CHECKING([whether to build Dillo plugin])
  885. AC_ARG_ENABLE(dillo-viewer-plugin,
  886. [ --disable-dillo-viewer-plugin do not build Dillo plugin for html mail rendering],
  887. [ac_cv_enable_dillo_viewer_plugin=$enableval], [ac_cv_enable_dillo_viewer_plugin=yes])
  888. if test x"$ac_cv_enable_dillo_viewer_plugin" = xyes; then
  889. AC_MSG_RESULT(yes)
  890. PLUGINS="dillo-viewer $PLUGINS"
  891. else
  892. AC_MSG_RESULT(no)
  893. fi
  894. AM_CONDITIONAL(BUILD_DILLO_VIEWER_PLUGIN, test x"$ac_cv_enable_dillo_viewer_plugin" = xyes)
  895. dnl --- Demo ---
  896. AC_ARG_ENABLE(demo-plugin,
  897. [ --enable-demo-plugin build demo plugin],
  898. [ac_cv_enable_demo_plugin=$enableval], [ac_cv_enable_demo_plugin=no])
  899. if test x"$ac_cv_enable_demo_plugin" = xyes; then
  900. PLUGINS="demo $PLUGINS"
  901. fi
  902. AM_CONDITIONAL(BUILD_DEMO_PLUGIN, test x"$ac_cv_enable_demo_plugin" = xyes)
  903. dnl Libetpan
  904. AC_MSG_CHECKING([whether to use libetpan])
  905. AC_ARG_ENABLE(libetpan,
  906. [ --disable-libetpan disable IMAP4/NNTP (libetpan) support],
  907. [ac_cv_enable_libetpan=$enableval], [ac_cv_enable_libetpan=yes])
  908. if test x"$ac_cv_enable_libetpan" = xyes; then
  909. AC_MSG_RESULT(yes)
  910. libetpan_result=no
  911. AC_PATH_PROG(libetpanconfig, [libetpan-config])
  912. if test "x$libetpanconfig" != "x"; then
  913. CPPFLAGS="$CPPFLAGS `$libetpanconfig --cflags 2>/dev/null`"
  914. AC_CHECK_HEADER(libetpan/libetpan.h, [libetpan_result=yes])
  915. if test "x$libetpan_result" = "xyes"; then
  916. AC_MSG_CHECKING([whether libetpan-config hints compiles and links fine])
  917. LIBS="$LIBS `$libetpanconfig --libs 2>/dev/null`"
  918. AC_TRY_LINK([#include <libetpan/dbstorage.h>], [db_mailstorage_init(NULL, NULL);], [libetpan_result=yes], [libetpan_result=no])
  919. AC_MSG_RESULT([$libetpan_result])
  920. fi
  921. fi
  922. if test "x$libetpan_result" = "xyes"; then
  923. LIBETPAN_CPPFLAGS="`$libetpanconfig --cflags`"
  924. LIBETPAN_LIBS="`$libetpanconfig --libs`"
  925. LIBETPAN_STABLE=`$libetpanconfig --version | grep -v ^0`
  926. LIBETPAN_VERSION=`$libetpanconfig --version | sed "s/\.//g" | sed "s/-.*$//"`
  927. if test x"$LIBETPAN_STABLE" != "x"; then
  928. LIBETPAN_VERSION="100"
  929. fi
  930. if test "$LIBETPAN_VERSION" -lt "057"; then
  931. AC_MSG_RESULT([*** Claws Mail requires libetpan 0.57 or newer. See http://www.etpan.org/])
  932. AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 and/or NNTP support.])
  933. AC_MSG_ERROR([libetpan 0.57 not found])
  934. fi
  935. AC_SUBST(LIBETPAN_FLAGS)
  936. AC_SUBST(LIBETPAN_LIBS)
  937. AC_DEFINE(HAVE_LIBETPAN, 1, Define if you want IMAP and/or NNTP support.)
  938. else
  939. AC_MSG_RESULT([*** Claws Mail requires libetpan 0.57 or newer. See http://www.etpan.org/ ])
  940. AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 and/or NNTP support.])
  941. AC_MSG_ERROR([libetpan 0.57 not found])
  942. fi
  943. else
  944. AC_MSG_RESULT(no)
  945. fi
  946. AM_CONDITIONAL(CLAWS_LIBETPAN, test "x$libetpan_result" = "xyes")
  947. AC_MSG_CHECKING([whether to use valgrind])
  948. AC_ARG_ENABLE(valgrind,
  949. [ --disable-valgrind disable valgrind support for debugging],
  950. [ac_cv_enable_valgrind=$enableval], [ac_cv_enable_valgrind=yes])
  951. if test x$ac_cv_enable_valgrind = xyes; then
  952. AC_MSG_RESULT(yes)
  953. PKG_CHECK_MODULES(VALGRIND, valgrind >= 2.4.0,
  954. ac_cv_enable_valgrind=yes, ac_cv_enable_valgrind=no)
  955. if test x"$ac_cv_enable_valgrind" = xyes; then
  956. AC_DEFINE(HAVE_VALGRIND, 1, Define if you want valgrind support)
  957. else
  958. AC_MSG_RESULT(not found)
  959. fi
  960. else
  961. AC_MSG_RESULT(no)
  962. fi
  963. AM_CONDITIONAL(CLAWS_VALGRIND, test x"$ac_cv_enable_valgrind" = x"yes")
  964. dnl ****************************
  965. dnl ** Final configure output **
  966. dnl ****************************
  967. AC_OUTPUT([
  968. Makefile
  969. m4/Makefile
  970. po/Makefile.in
  971. src/common/version.h
  972. src/Makefile
  973. src/common/Makefile
  974. src/common/passcrypt.h
  975. src/gtk/Makefile
  976. src/etpan/Makefile
  977. src/plugins/Makefile
  978. src/plugins/demo/Makefile
  979. src/plugins/bogofilter/Makefile
  980. src/plugins/spamassassin/Makefile
  981. src/plugins/dillo_viewer/Makefile
  982. src/plugins/trayicon/Makefile
  983. src/plugins/pgpcore/Makefile
  984. src/plugins/pgpmime/Makefile
  985. src/plugins/pgpinline/Makefile
  986. src/plugins/smime/Makefile
  987. doc/Makefile
  988. doc/man/Makefile
  989. tools/Makefile
  990. config/Makefile
  991. manual/Makefile
  992. manual/dtd/Makefile
  993. manual/dist/Makefile
  994. manual/dist/pdf/Makefile
  995. manual/dist/ps/Makefile
  996. manual/dist/html/Makefile
  997. manual/dist/txt/Makefile
  998. manual/fr/Makefile
  999. manual/fr/dist/Makefile
  1000. manual/fr/dist/pdf/Makefile
  1001. manual/fr/dist/ps/Makefile
  1002. manual/fr/dist/html/Makefile
  1003. manual/fr/dist/txt/Makefile
  1004. manual/pl/Makefile
  1005. manual/pl/dist/Makefile
  1006. manual/pl/dist/pdf/Makefile
  1007. manual/pl/dist/ps/Makefile
  1008. manual/pl/dist/html/Makefile
  1009. manual/pl/dist/txt/Makefile
  1010. manual/es/Makefile
  1011. manual/es/dist/Makefile
  1012. manual/es/dist/pdf/Makefile
  1013. manual/es/dist/ps/Makefile
  1014. manual/es/dist/html/Makefile
  1015. manual/es/dist/txt/Makefile
  1016. manual/de/Makefile
  1017. manual/de/dist/Makefile
  1018. manual/de/dist/pdf/Makefile
  1019. manual/de/dist/ps/Makefile
  1020. manual/de/dist/html/Makefile
  1021. manual/de/dist/txt/Makefile
  1022. claws-mail.pc
  1023. ])
  1024. dnl Output the configuration summary
  1025. echo ""
  1026. echo "$PACKAGE $VERSION"
  1027. echo ""
  1028. if test x"$enable_new_addrbook" = xyes; then
  1029. echo "Using Address Book : New experimental interface"
  1030. else
  1031. echo "Using Address Book : Old stable interface"
  1032. echo "JPilot : $ac_cv_enable_jpilot"
  1033. echo "LDAP : $ac_cv_enable_ldap"
  1034. fi
  1035. echo "gnuTLS : $ac_cv_enable_gnutls"
  1036. echo "iconv : $am_cv_func_iconv"
  1037. echo "compface : $ac_cv_enable_compface"
  1038. echo "IPv6 : $ac_cv_enable_ipv6"
  1039. echo "enchant : $ac_cv_enable_enchant"
  1040. echo "IMAP4 : $ac_cv_enable_libetpan"
  1041. echo "NNTP : $ac_cv_enable_libetpan"
  1042. echo "Crash dialog : $ac_cv_enable_crash_dialog"
  1043. echo "LibSM : $ac_cv_enable_libsm"
  1044. echo "DBUS : $enable_dbus"
  1045. echo "NetworkManager : $enable_networkmanager_support"
  1046. echo "Manual : $ac_cv_enable_manual"
  1047. echo "Plugins : $PLUGINS"
  1048. echo "Generic UMPC code : $ac_cv_enable_generic_umpc"
  1049. echo "Maemo build : $ac_cv_enable_maemo"
  1050. echo "Config dir : $ac_cv_with_config_dir"
  1051. echo ""
  1052. echo "The binary will be installed in $prefix/bin"
  1053. echo ""
  1054. echo "Configure finished, type 'make' to build."