configure.ac 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911
  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_PREREQ(2.60)
  3. AC_INIT(src/main.c)
  4. AC_CONFIG_AUX_DIR(config)
  5. PACKAGE=claws-mail
  6. dnl version number
  7. MAJOR_VERSION=2
  8. MINOR_VERSION=8
  9. MICRO_VERSION=1
  10. INTERFACE_AGE=0
  11. BINARY_AGE=0
  12. EXTRA_VERSION=0
  13. EXTRA_RELEASE=
  14. EXTRA_GTK2_VERSION=-stable
  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. dnl GNOME 2.x installed?
  46. PKG_CHECK_MODULES(GNOME2, libgnome-2.0 >= 2.0, ac_enable_gnome2=yes, ac_enable_gnome2=no)
  47. AM_CONDITIONAL(CLAWS_GNOME2, test x"$ac_enable_gnome2" = x"yes")
  48. dnl libtool versioning
  49. LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
  50. LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
  51. LT_REVISION=$INTERFACE_AGE
  52. LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
  53. AC_SUBST(LT_RELEASE)
  54. AC_SUBST(LT_CURRENT)
  55. AC_SUBST(LT_REVISION)
  56. AC_SUBST(LT_AGE)
  57. dnl Specify a header configuration file
  58. AC_CONFIG_HEADERS(config.h)
  59. AM_MAINTAINER_MODE
  60. dnl Checks for programs.
  61. dnl AC_ARG_PROGRAM
  62. AC_PROG_CC
  63. AC_ISC_POSIX
  64. AC_PROG_INSTALL
  65. AC_PROG_LN_S
  66. AC_PROG_MAKE_SET
  67. AC_PROG_CPP
  68. dnl AC_PROG_RANLIB
  69. AM_PROG_LEX
  70. AC_PROG_YACC
  71. AC_LIB_PREFIX
  72. AC_LIBTOOL_WIN32_DLL
  73. AC_LIBTOOL_RC
  74. AC_PROG_LIBTOOL
  75. CLAWS_ACLOCAL_INCLUDE(m4)
  76. dnl ******************************
  77. dnl Checks for host
  78. dnl Not needed anymore because we
  79. dnl do AC_CANONICAL_SYSTEM above
  80. dnl ******************************
  81. dnl AC_CANONICAL_HOST
  82. dnl Copied from the official gtk+-2 configure.in
  83. AC_MSG_CHECKING([for some Win32 platform])
  84. case "$host" in
  85. *-*-mingw*|*-*-cygwin*)
  86. platform_win32=yes
  87. LDFLAGS="$LDFLAGS -mwindows"
  88. ;;
  89. *)
  90. platform_win32=no
  91. ;;
  92. esac
  93. AC_MSG_RESULT([$platform_win32])
  94. AM_CONDITIONAL(PLATFORM_WIN32, test x"$platform_win32" = x"yes")
  95. AC_MSG_CHECKING([for native Win32])
  96. case "$host" in
  97. *-*-mingw*)
  98. os_win32=yes
  99. ;;
  100. *)
  101. os_win32=no
  102. ;;
  103. esac
  104. AC_MSG_RESULT([$os_win32])
  105. AM_CONDITIONAL(OS_WIN32, test x"$os_win32" = x"yes")
  106. AC_MSG_CHECKING([for Cygwin])
  107. case "$host" in
  108. *-*-cygwin*)
  109. env_cygwin=yes
  110. ;;
  111. *)
  112. env_cygwin=no
  113. ;;
  114. esac
  115. AC_MSG_RESULT([$env_cygwin])
  116. AM_CONDITIONAL(CYGWIN, test x"$env_cygwin" = x"yes")
  117. CFLAGS="$CFLAGS -Wall"
  118. pthread_name=
  119. case "$target" in
  120. *-darwin*)
  121. CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
  122. ;;
  123. *-*-mingw*)
  124. # Note that we need to link to pthreadGC2 in all cases. This
  125. # is because some locking is used even when pthread support is
  126. # disabled.
  127. pthread_name=pthreadGC2
  128. CFLAGS="$CFLAGS -mms-bitfields"
  129. LIBS="$LIBS -l${pthread_name} -lws2_32 -lregex"
  130. ;;
  131. esac
  132. dnl Checks for iconv
  133. AM_ICONV
  134. dnl
  135. dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
  136. dnl
  137. syl_save_LIBS=$LIBS
  138. LIBS="$LIBS $GTK_LIBS"
  139. AC_CHECK_FUNCS(bind_textdomain_codeset)
  140. LIBS=$syl_save_LIBS
  141. dnl for gettext
  142. ALL_LINGUAS="bg ca cs de el en_GB es fi fr hr hu it ja ko nb nl pl pt_BR ru sk sr sv zh_CN zh_TW"
  143. GETTEXT_PACKAGE=claws-mail
  144. AC_SUBST(GETTEXT_PACKAGE)
  145. AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define text domain.])
  146. AM_GNU_GETTEXT_VERSION([0.15])
  147. AM_GNU_GETTEXT([external])
  148. manualdir='${docdir}/manual'
  149. AC_ARG_WITH(manualdir,
  150. [ --with-manualdir=DIR Manual directory],
  151. [manualdir="$withval"])
  152. AC_SUBST(manualdir)
  153. AC_ARG_ENABLE(manual,
  154. [ --disable-manual Disable manual support],
  155. [ac_cv_enable_manual=$enableval], [ac_cv_enable_manual=yes])
  156. AM_CONDITIONAL(BUILD_MANUAL, test x"$ac_cv_enable_manual" = xyes)
  157. dnl Set PACKAGE_DATA_DIR in config.h.
  158. if test "x${datarootdir}" = 'x${prefix}/share'; then
  159. if test "x${prefix}" = "xNONE"; then
  160. AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}",[PACKAGE_DATA_DIR])
  161. else
  162. AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}",[PACKAGE_DATA_DIR])
  163. fi
  164. else
  165. AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datarootdir}/${PACKAGE}",[PACKAGE_DATA_DIR])
  166. fi
  167. AC_CHECK_LIB(xpg4, setlocale)
  168. SM_LIBS=""
  169. dnl Check for LibSM
  170. AC_ARG_ENABLE(libsm,
  171. [ --disable-libsm Do not use libSM for session management.],
  172. [ac_cv_enable_libsm=$enableval], [ac_cv_enable_libsm=yes])
  173. AC_MSG_CHECKING([whether to use LibSM])
  174. if test x"$ac_cv_enable_libsm" = xyes; then
  175. AC_MSG_RESULT(yes)
  176. AC_CHECK_LIB(SM, SmcSaveYourselfDone,
  177. [SM_LIBS="$X_LIBS -lSM -lICE"],ac_cv_enable_libsm=no,
  178. $X_LIBS -lICE)
  179. AC_CHECK_HEADERS(X11/SM/SMlib.h,,ac_cv_enable_libsm=no)
  180. if test x"$ac_cv_enable_libsm" = xyes; then
  181. AC_DEFINE(HAVE_LIBSM, 1, [Define to 1 if you have libSM installed])
  182. else
  183. AC_MSG_RESULT(not found)
  184. AC_MSG_WARN([*** LibSM will not be supported ***])
  185. fi
  186. else
  187. AC_MSG_RESULT(no)
  188. fi
  189. AC_SUBST(SM_LIBS)
  190. dnl for GThread support (currently disabled)
  191. dnl AC_ARG_ENABLE(threads,
  192. dnl [ --enable-threads Enable multithread support [default=no]],
  193. dnl [use_threads=$enableval], [use_threads=no])
  194. AC_MSG_CHECKING([whether to use threads])
  195. if test x"$use_threads" = xyes ; then
  196. AC_MSG_RESULT(yes)
  197. if test ! -z `$GLIB_CONFIG --help 2>&1 |grep 'gthread'` ; then
  198. CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
  199. LIBS="$LIBS `$GLIB_CONFIG --libs gthread`"
  200. AC_DEFINE(USE_THREADS, 1, Whether to use multithread or not)
  201. else
  202. AC_MSG_ERROR([Sylpheed requires GThread from GLib to use threading.])
  203. fi
  204. else
  205. AC_MSG_RESULT(no)
  206. fi
  207. dnl Check for d_type member in struct dirent
  208. AC_MSG_CHECKING([whether struct dirent has d_type member])
  209. AC_CACHE_VAL(ac_cv_dirent_d_type,[
  210. AC_TRY_COMPILE([#include <dirent.h>],
  211. [struct dirent d; d.d_type = DT_REG;],
  212. ac_cv_dirent_d_type=yes, ac_cv_dirent_d_type=no)
  213. ])
  214. AC_MSG_RESULT($ac_cv_dirent_d_type)
  215. if test $ac_cv_dirent_d_type = yes; then
  216. AC_DEFINE(HAVE_DIRENT_D_TYPE, 1,
  217. Define if `struct dirent' has `d_type' member.)
  218. fi
  219. # Check whether mkdir does not take the permission argument.
  220. GNUPG_FUNC_MKDIR_TAKES_ONE_ARG
  221. dnl Checks for header files.
  222. AC_HEADER_DIRENT
  223. AC_HEADER_STDC
  224. AC_HEADER_SYS_WAIT
  225. AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
  226. sys/param.h sys/utsname.h sys/select.h \
  227. wchar.h wctype.h locale.h netdb.h)
  228. dnl alf - Check for apache installation f*ck up. apache may also install an
  229. dnl fnmatch, which includes their own regex stuff if USE_HSREGEX is defined
  230. AC_TRY_COMPILE([#include <stdlib.h>
  231. #include <fnmatch.h>],
  232. [int x = USE_HSREGEX;],
  233. ac_cv_have_apache_fnmatch=yes, ac_cv_have_apache_fnmatch=no)
  234. if test $ac_cv_have_apache_fnmatch = yes; then
  235. AC_DEFINE(HAVE_APACHE_FNMATCH, 1, Define if you need to work around apache regex/fnmatch !KLUDGE!)
  236. fi
  237. AC_MSG_CHECKING([whether to use Apache regex header kludge])
  238. AC_MSG_RESULT($ac_cv_have_apache_fnmatch)
  239. dnl Checks for typedefs, structures, and compiler characteristics.
  240. AC_C_CONST
  241. AC_TYPE_OFF_T
  242. AC_TYPE_PID_T
  243. AC_TYPE_SIZE_T
  244. AC_STRUCT_TM
  245. dnl AC_CHECK_TYPE(wint_t, unsigned int) does not work because wint_t
  246. dnl may be defined only in wchar.h (this happens with gcc-2.96).
  247. dnl So we need to use this extended macro.
  248. CLAWS_CHECK_TYPE(wint_t, unsigned int,
  249. [
  250. #if HAVE_WCHAR_H
  251. #include <wchar.h>
  252. #endif
  253. ], Define to `unsigned int' if <stddef.h> or <wchar.h> doesn't define.)
  254. GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF, Used to test for a u32 typedef)
  255. AC_CHECK_SIZEOF(unsigned short, 2)
  256. AC_CHECK_SIZEOF(unsigned int, 4)
  257. AC_CHECK_SIZEOF(unsigned long, 4)
  258. dnl Checks for library functions.
  259. AC_FUNC_ALLOCA
  260. AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr strchr \
  261. uname flock lockf inet_aton inet_addr \
  262. fchmod mkstemp truncate getuid regcomp)
  263. AC_CHECK_FUNCS(fgets_unlocked fwrite_unlocked)
  264. dnl *****************
  265. dnl ** common code **
  266. dnl *****************
  267. dnl check for glib
  268. AM_PATH_GLIB_2_0(2.6.0,,
  269. AC_MSG_ERROR(Test for GLIB failed. See the file 'INSTALL' for help.),
  270. gmodule gobject gthread)
  271. dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
  272. syl_save_LIBS=$LIBS
  273. LIBS="$LIBS $GTK_LIBS"
  274. AC_CHECK_FUNCS(bind_textdomain_codeset)
  275. LIBS=$syl_save_LIBS
  276. dnl check for IPv6 option
  277. AC_ARG_ENABLE(ipv6,
  278. [ --disable-ipv6 Disable IPv6 support],
  279. [ac_cv_enable_ipv6=$enableval], [ac_cv_enable_ipv6=yes])
  280. dnl automated checks for IPv6 support.
  281. AC_MSG_CHECKING([whether to use IPv6])
  282. if test x"$ac_cv_enable_ipv6" = xyes; then
  283. AC_MSG_RESULT(yes)
  284. AC_MSG_CHECKING([for IPv6 support])
  285. AC_CACHE_VAL(ac_cv_ipv6,[
  286. AC_TRY_COMPILE([#define INET6
  287. #include <sys/types.h>
  288. #include <netinet/in.h>],
  289. [int x = IPPROTO_IPV6; struct in6_addr a;],
  290. ac_cv_ipv6=yes, ac_cv_ipv6=no)
  291. ])
  292. AC_MSG_RESULT($ac_cv_ipv6)
  293. if test $ac_cv_ipv6 = yes; then
  294. AC_DEFINE(INET6, 1, Define if you want IPv6 support.)
  295. else
  296. AC_MSG_WARN(*** IPv6 will not be supported ***)
  297. ac_cv_enable_ipv6=no
  298. fi
  299. else
  300. AC_MSG_RESULT(no)
  301. fi
  302. dnl Check for OpenSSL
  303. AC_ARG_ENABLE(openssl,
  304. [ --disable-openssl Do not use OpenSSL for SSL support.],
  305. [ac_cv_enable_openssl=$enableval], [ac_cv_enable_openssl=yes])
  306. AC_MSG_CHECKING([whether to use OpenSSL])
  307. if test x"$ac_cv_enable_openssl" = xyes; then
  308. AC_MSG_RESULT(yes)
  309. PKG_CHECK_MODULES(OPENSSL, openssl >= 0.9.7, :, ac_cv_enable_openssl=no)
  310. if test x$ac_cv_enable_openssl = xyes; then
  311. AC_DEFINE(USE_OPENSSL, 1, Define if you want OpenSSL support)
  312. else
  313. AC_MSG_RESULT(not found)
  314. AC_MSG_WARN([*** OpenSSL will not be supported ***])
  315. fi
  316. else
  317. AC_MSG_RESULT(no)
  318. fi
  319. AC_SUBST(OPENSSL_CFLAGS)
  320. AC_SUBST(OPENSSL_LIBS)
  321. dnl password encryption
  322. OLDLIBS=$LIBS
  323. LIBS=
  324. case $host_os in
  325. *dragonfly*)
  326. AC_SEARCH_LIBS(encrypt, cipher, [], AC_MSG_ERROR(['encrypt'-function not found.]))
  327. ;;
  328. *)
  329. AC_SEARCH_LIBS(encrypt, crypt, [], AC_MSG_ERROR(['encrypt'-function not found.]))
  330. ;;
  331. esac
  332. CRYPT_LIBS=$LIBS
  333. AC_SUBST(CRYPT_LIBS)
  334. LIBS=$OLDLIBS
  335. AC_ARG_WITH(passcrypt-key, [ --with-passcrypt-key=KEY Key used to encode passwords (8 byte string)],
  336. with_passcrypt_key="$withval", with_passcrypt_key="passkey0")
  337. AC_SUBST(PASSCRYPT_KEY, $with_passcrypt_key)
  338. dnl RC dir (will be default at a certain point in time)
  339. AC_ARG_WITH(config-dir, [ --with-config-dir=RCDIR Local configuration dir (default: .claws-mail)],
  340. ac_cv_with_config_dir="$withval", ac_cv_with_config_dir=".claws-mail")
  341. if test x"$ac_cv_with_config_dir" = x""; then
  342. ac_cv_with_config_dir=".claws-mail"
  343. fi
  344. AC_DEFINE_UNQUOTED(CFG_RC_DIR, "$ac_cv_with_config_dir", Configuration directory)
  345. dnl ************************
  346. dnl ** GTK user interface **
  347. dnl ************************
  348. dnl Checks for GTK
  349. AM_PATH_GTK_2_0(2.6.0,,
  350. AC_MSG_ERROR(Test for GTK failed. See the file 'INSTALL' for help.))
  351. dnl --disable-deprecated switch for GTK2 purification
  352. AC_ARG_ENABLE(deprecated, [ --disable-deprecated Disable deprecated GTK functions. ],
  353. [GTK_CFLAGS="$GTK_CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"], [])
  354. AC_SUBST(GTK_CFLAGS)
  355. AC_SUBST(GTK_LIBS)
  356. dnl GNU/Aspell is used for spell checking
  357. AC_ARG_ENABLE(aspell,
  358. [ --disable-aspell Disable GNU/aspell support [default=yes]],
  359. [ac_cv_enable_aspell=$enableval], [ac_cv_enable_aspell=yes])
  360. AC_MSG_CHECKING([whether to use GNU/aspell])
  361. if test $ac_cv_enable_aspell = yes; then
  362. AC_MSG_RESULT(yes)
  363. AM_PATH_ASPELL(0.50, AC_DEFINE(USE_ASPELL, 1, Define if you use ASPELL to support spell checking),
  364. [use_aspell=no ac_cv_enable_aspell=no])
  365. else
  366. AC_MSG_RESULT(no)
  367. fi
  368. dnl want crash dialog
  369. AC_ARG_ENABLE(crash-dialog,
  370. [ --enable-crash-dialog Enable crash dialog [default=no]],
  371. [ac_cv_enable_crash_dialog=$enableval], [ac_cv_enable_crash_dialog=no])
  372. if test $ac_cv_enable_crash_dialog = yes; then
  373. dnl check if GDB is somewhere
  374. AC_CHECK_PROG(ac_cv_enable_crash_dialog, gdb, yes, no)
  375. AC_MSG_CHECKING([whether to use crash dialog])
  376. if test $ac_cv_enable_crash_dialog = yes; then
  377. AC_DEFINE(CRASH_DIALOG, 1, Pop up crash dialog)
  378. fi
  379. AC_MSG_RESULT($ac_cv_enable_crash_dialog)
  380. fi
  381. dnl Check for X-Face support
  382. AC_ARG_ENABLE(compface,
  383. [ --disable-compface Do not use compface (X-Face)],
  384. [ac_cv_enable_compface=$enableval], [ac_cv_enable_compface=yes])
  385. AC_MSG_CHECKING([whether to use compface])
  386. if test x"$ac_cv_enable_compface" = xyes; then
  387. AC_MSG_RESULT(yes)
  388. AC_CHECK_LIB(compface, uncompface,
  389. [AC_DEFINE(HAVE_LIBCOMPFACE, 1, Define if you want compface support.)],
  390. [ac_cv_enable_compface=no])
  391. if test x"$ac_cv_enable_compface" = xyes; then
  392. COMPFACE_LIBS="-lcompface"
  393. else
  394. COMPFACE_LIBS=""
  395. fi
  396. AC_SUBST(COMPFACE_LIBS)
  397. else
  398. AC_MSG_RESULT(no)
  399. fi
  400. dnl check for pthread support
  401. AC_ARG_ENABLE(pthread,
  402. [ --disable-pthread Disable pthread support],
  403. [ac_cv_enable_pthread=$enableval], [ac_cv_enable_pthread=yes])
  404. AC_MSG_CHECKING([whether to use pthread])
  405. if test x$ac_cv_enable_pthread = xno; then
  406. AC_MSG_RESULT(no)
  407. else
  408. AC_MSG_RESULT(yes)
  409. # For W32 we need to use a special ptrhead lib. In this case we can't
  410. # use AC_CHECK_LIB because it has no means of checking for a
  411. # library installed under a different name. Checking for the
  412. # header is okay.
  413. if test -n "${pthread_name}" ; then
  414. ac_cv_enable_pthread=yes
  415. else
  416. AC_CHECK_LIB(pthread, pthread_create, :, ac_cv_enable_pthread=no)
  417. fi
  418. AC_CHECK_HEADERS(pthread.h, :, ac_cv_enable_pthread=no)
  419. if test x$ac_cv_enable_pthread = xyes; then
  420. AC_DEFINE(USE_PTHREAD, 1, Define if you have pthread)
  421. if test -z "${pthread_name}" ; then
  422. PTHREAD_LIBS="-lpthread"
  423. fi
  424. fi
  425. fi
  426. AC_SUBST(PTHREAD_LIBS)
  427. dnl
  428. dnl Check whether we need to pass -lresolv
  429. dnl We know that we don't need it for W32.
  430. dnl
  431. if test x$os_win32 = xno; then
  432. t_oldLibs="$LIBS"
  433. LIBS="$LIBS"
  434. ac_cv_var__res_options=no
  435. AC_TRY_LINK([#include <sys/types.h>
  436. #include <sys/socket.h>
  437. #include <netinet/in.h>
  438. #include <arpa/nameser.h>
  439. #include <resolv.h>],
  440. [_res.options = RES_INIT;],
  441. ac_cv_var__res_options=yes);
  442. if test "$ac_cv_var__res_options" != "yes"; then
  443. LIBRESOLV="-lresolv"
  444. fi
  445. LIBS="$t_oldLibs"
  446. if test "x$LIBRESOLV" = "x"; then
  447. AC_CHECK_LIB(resolv, res_query, [LIBRESOLV=-lresolv])
  448. LIBS="$t_oldLibs"
  449. fi
  450. fi
  451. AC_SUBST(LIBRESOLV)
  452. LIBS="$LIBS $LIBRESOLV"
  453. dnl for LDAP support in addressbook
  454. dnl no check for libraries; dynamically loaded
  455. AC_ARG_ENABLE(ldap,
  456. [ --disable-ldap Do not build LDAP support [default=yes]],
  457. [ac_cv_enable_ldap=$enableval], [ac_cv_enable_ldap=yes])
  458. AC_MSG_CHECKING([whether to use LDAP])
  459. if test x"$ac_cv_enable_ldap" = xno; then
  460. AC_MSG_RESULT(no)
  461. elif test x"$ac_cv_enable_ldap" = xyes -a x"$ac_cv_enable_pthread" = xno; then
  462. AC_MSG_RESULT(no - LDAP support needs pthread support)
  463. ac_cv_enable_ldap=no
  464. else
  465. AC_MSG_RESULT(yes)
  466. dnl check for available libraries, and pull them in
  467. AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="$LDAP_LIBS -lresolv")
  468. AC_CHECK_LIB(socket, bind, LDAP_LIBS="$LDAP_LIBS -lsocket")
  469. AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl")
  470. AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS="$LDAP_LIBS -llber",,
  471. $LDAP_LIBS)
  472. AC_CHECK_HEADERS(ldap.h lber.h,
  473. [ ac_cv_enable_ldap=yes ],
  474. [ ac_cv_enable_ldap=no ])
  475. if test "$ac_cv_enable_ldap" = yes; then
  476. AC_CHECK_LIB(ldap, ldap_open,
  477. [ ac_cv_enable_ldap=yes ],
  478. [ ac_cv_enable_ldap=no ],
  479. $LDAP_LIBS)
  480. AC_CHECK_LIB(ldap, ldap_start_tls_s,
  481. [ ac_cv_have_tls=yes ],
  482. [ ac_cv_have_tls=no ])
  483. fi
  484. AC_MSG_CHECKING([whether ldap library is available])
  485. AC_MSG_RESULT($ac_cv_enable_ldap)
  486. AC_MSG_CHECKING([whether TLS library is available])
  487. AC_MSG_RESULT($ac_cv_have_tls)
  488. if test "$ac_cv_enable_ldap" = yes; then
  489. AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
  490. LDAP_LIBS="$LDAP_LIBS -lldap"
  491. AC_SUBST(LDAP_LIBS)
  492. if test "$ac_cv_have_tls" = yes; then
  493. AC_DEFINE(USE_LDAP_TLS, 1, Define if you want LDAP TLS support in addressbook.)
  494. fi
  495. fi
  496. fi
  497. dnl for JPilot support in addressbook
  498. dnl no check for libraries; these are dynamically loaded
  499. AC_ARG_ENABLE(jpilot,
  500. [ --disable-jpilot Enable JPilot support [default=yes]],
  501. [ac_cv_enable_jpilot=$enableval], [ac_cv_enable_jpilot=yes])
  502. AC_MSG_CHECKING([whether to use JPilot])
  503. if test "$ac_cv_enable_jpilot" = yes; then
  504. AC_MSG_RESULT(yes)
  505. AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h pi-version.h,
  506. [ AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ],
  507. [ ac_cv_enable_jpilot=no ])
  508. if test "$ac_cv_enable_jpilot" = no; then
  509. AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h libpisock/pi-version.h,
  510. [ ac_cv_enable_jpilot=yes
  511. AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ])
  512. fi
  513. AC_CHECK_LIB(pisock, unpack_Address, [JPILOT_LIBS="-lpisock"], [JPILOT_LIBS="" ac_cv_enable_jpilot="no"])
  514. if test x"$ac_cv_enable_jpilot" = xyes; then
  515. AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.)
  516. else
  517. AC_MSG_NOTICE([JPilot support not available])
  518. fi
  519. AC_SUBST(JPILOT_LIBS)
  520. else
  521. AC_MSG_RESULT(no)
  522. fi
  523. dnl #######################################################################
  524. dnl # Check for startup notification
  525. dnl #######################################################################
  526. AC_ARG_ENABLE(startup-notification, [ --disable-startup-notification compile without startup notification support],,enable_startup_notification=yes)
  527. if test "x$enable_startup_notification" = "xyes"; then
  528. PKG_CHECK_MODULES(STARTUP_NOTIFICATION, libstartup-notification-1.0 >= 0.5,
  529. [
  530. AC_DEFINE(HAVE_STARTUP_NOTIFICATION, 1, [Define if we're using libstartup-notification.])
  531. echo "Building with libstartup-notification"
  532. enable_startup_notification=yes
  533. ],
  534. [
  535. echo "Building without libstartup-notification"
  536. enable_startup_notification=no
  537. ])
  538. AC_SUBST(STARTUP_NOTIFICATION_CFLAGS)
  539. AC_SUBST(STARTUP_NOTIFICATION_LIBS)
  540. fi
  541. dnl *************************
  542. dnl ** section for plugins **
  543. dnl *************************
  544. PLUGINS=""
  545. dnl --- Trayicon ---
  546. AC_MSG_CHECKING([whether to build Trayicon plugin])
  547. AC_ARG_ENABLE(trayicon-plugin,
  548. [ --disable-trayicon-plugin Do not build System Tray Icon plugin],
  549. [ac_cv_enable_trayicon_plugin=$enableval], [ac_cv_enable_trayicon_plugin=yes])
  550. if test x"$ac_cv_enable_trayicon_plugin" = xyes; then
  551. AC_MSG_RESULT(yes)
  552. PLUGINS="trayicon $PLUGINS"
  553. else
  554. AC_MSG_RESULT(no)
  555. fi
  556. AM_CONDITIONAL(BUILD_TRAYICON_PLUGIN, test x"$ac_cv_enable_trayicon_plugin" = xyes)
  557. dnl --- SpamAssassin ---
  558. AC_MSG_CHECKING([whether to build SpamAssassin plugin])
  559. AC_ARG_ENABLE(spamassassin-plugin,
  560. [ --disable-spamassassin-plugin Build SpamAssassin plugin [default=yes]],
  561. [ac_cv_enable_spamassassin_plugin=$enableval], [ac_cv_enable_spamassassin_plugin=yes])
  562. if test x"$ac_cv_enable_spamassassin_plugin" = xyes; then
  563. AC_MSG_RESULT(yes)
  564. AC_SPAMASSASSIN
  565. PLUGINS="spamassassin $PLUGINS"
  566. AC_DEFINE(USE_SPAMASSASSIN_PLUGIN, 1, Define if spamassassin plugin is being build.)
  567. else
  568. AC_MSG_RESULT(no)
  569. fi
  570. AM_CONDITIONAL(BUILD_SPAMASSASSIN_PLUGIN, test x"$ac_cv_enable_spamassassin_plugin" = xyes)
  571. dnl --- Bogofilter ---
  572. AC_MSG_CHECKING([whether to build Bogofilter plugin])
  573. AC_ARG_ENABLE(bogofilter-plugin,
  574. [ --disable-bogofilter-plugin Build bogofilter plugin [default=yes]],
  575. [ac_cv_enable_bogofilter_plugin=$enableval], [ac_cv_enable_bogofilter_plugin=yes])
  576. if test x"$ac_cv_enable_bogofilter_plugin" = xyes; then
  577. AC_MSG_RESULT(yes)
  578. PLUGINS="bogofilter $PLUGINS"
  579. AC_DEFINE(USE_BOGOFILTER_PLUGIN, 1, Define if bogofilter plugin is being build.)
  580. else
  581. AC_MSG_RESULT(no)
  582. fi
  583. AM_CONDITIONAL(BUILD_BOGOFILTER_PLUGIN, test x"$ac_cv_enable_bogofilter_plugin" = xyes)
  584. dnl --- PGP/CORE ---
  585. AC_MSG_CHECKING([whether to build PGP/CORE plugin])
  586. AC_ARG_ENABLE(pgpcore-plugin,
  587. [ --disable-pgpcore-plugin Do not build PGP/Core plugin],
  588. [ac_cv_enable_pgpcore_plugin=$enableval], [ac_cv_enable_pgpcore_plugin=yes])
  589. if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
  590. AC_MSG_RESULT(yes)
  591. AM_PATH_GPGME(1.0.0, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.),
  592. [ac_cv_enable_pgpcore_plugin=no])
  593. if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
  594. PLUGINS="pgpcore $PLUGINS"
  595. AM_PATH_GPGME(1.1.1,
  596. AC_DEFINE(HAVE_GPGME_PKA_TRUST, 1,
  597. [Define if GPGME supports PKA.]))
  598. #needed to get GPGME_LIBS and al correctly
  599. AM_PATH_GPGME(1.0.0, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.),
  600. [ac_cv_enable_pgpcore_plugin=no])
  601. else
  602. AC_MSG_WARN([*** PGP/CORE plugin will not be built ***])
  603. fi
  604. else
  605. AC_MSG_RESULT(no)
  606. fi
  607. AM_CONDITIONAL(BUILD_PGPCORE_PLUGIN, test x"$ac_cv_enable_pgpcore_plugin" = xyes)
  608. AC_MSG_CHECKING([whether to build PGP/MIME plugin])
  609. AC_ARG_ENABLE(pgpmime-plugin,
  610. [ --disable-pgpmime-plugin Do not build PGP/MIME plugin],
  611. [ac_cv_enable_pgpmime_plugin=$enableval], [ac_cv_enable_pgpmime_plugin=yes])
  612. if test x"$ac_cv_enable_pgpmime_plugin" = xyes; then
  613. AC_MSG_RESULT(yes)
  614. if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
  615. PLUGINS="pgpmime $PLUGINS"
  616. else
  617. AC_MSG_WARN([*** PGP/MIME plugin cannot be built ***])
  618. AC_MSG_WARN([*** without the PGP/CORE plugin ***])
  619. fi
  620. else
  621. AC_MSG_RESULT(no)
  622. fi
  623. AM_CONDITIONAL(BUILD_PGPMIME_PLUGIN, test x"$ac_cv_enable_pgpmime_plugin" = xyes)
  624. AC_MSG_CHECKING([whether to build PGP/Inline plugin])
  625. AC_ARG_ENABLE(pgpinline-plugin,
  626. [ --disable-pgpinline-plugin Do not build PGP/Inline plugin],
  627. [ac_cv_enable_pgpinline_plugin=$enableval], [ac_cv_enable_pgpinline_plugin=yes])
  628. if test x"$ac_cv_enable_pgpinline_plugin" = xyes; then
  629. AC_MSG_RESULT(yes)
  630. if test x"$ac_cv_enable_pgpcore_plugin" = xyes; then
  631. PLUGINS="pgpinline $PLUGINS"
  632. else
  633. AC_MSG_WARN([*** PGP/Inline plugin cannot be built ***])
  634. AC_MSG_WARN([*** without the PGP/CORE plugin ***])
  635. fi
  636. else
  637. AC_MSG_RESULT(no)
  638. fi
  639. AM_CONDITIONAL(BUILD_PGPINLINE_PLUGIN, test x"$ac_cv_enable_pgpinline_plugin" = xyes)
  640. dnl --- Dillo Viewer ---
  641. AC_MSG_CHECKING([whether to build Dillo plugin])
  642. AC_ARG_ENABLE(dillo-viewer-plugin,
  643. [ --disable-dillo-viewer-plugin Do not build Dillo plugin for html mail rendering],
  644. [ac_cv_enable_dillo_viewer_plugin=$enableval], [ac_cv_enable_dillo_viewer_plugin=yes])
  645. if test x"$ac_cv_enable_dillo_viewer_plugin" = xyes; then
  646. AC_MSG_RESULT(yes)
  647. PLUGINS="dillo-viewer $PLUGINS"
  648. else
  649. AC_MSG_RESULT(no)
  650. fi
  651. AM_CONDITIONAL(BUILD_DILLO_VIEWER_PLUGIN, test x"$ac_cv_enable_dillo_viewer_plugin" = xyes)
  652. dnl --- Demo ---
  653. AC_ARG_ENABLE(demo-plugin,
  654. [ --enable-demo-plugin Build demo plugin [default=no]],
  655. [ac_cv_enable_demo_plugin=$enableval], [ac_cv_enable_demo_plugin=no])
  656. if test x"$ac_cv_enable_demo_plugin" = xyes; then
  657. PLUGINS="demo $PLUGINS"
  658. fi
  659. AM_CONDITIONAL(BUILD_DEMO_PLUGIN, test x"$ac_cv_enable_demo_plugin" = xyes)
  660. dnl --- ClamAV ---
  661. AC_MSG_CHECKING([whether to build ClamAV plugin])
  662. AC_ARG_ENABLE(clamav-plugin,
  663. [ --disable-clamav-plugin Do not build Clam AntiVirus plugin],
  664. [ac_cv_enable_clamav_plugin=$enableval], [ac_cv_enable_clamav_plugin=yes])
  665. if test x"$ac_cv_enable_clamav_plugin" = xyes; then
  666. AC_MSG_RESULT(yes)
  667. PKG_CHECK_MODULES(CLAMAV, libclamav, ac_cv_enable_clamav_plugin=yes,
  668. ac_cv_enable_clamav_plugin=no)
  669. if test x"$ac_cv_enable_clamav_plugin" = xyes; then
  670. PLUGINS="clamav $PLUGINS"
  671. else
  672. AC_MSG_RESULT(not found)
  673. AC_MSG_WARN([*** ClamAV plugin will not be built ***])
  674. fi
  675. else
  676. AC_MSG_RESULT(no)
  677. fi
  678. AC_SUBST(CLAMAV_LIBS)
  679. AM_CONDITIONAL(BUILD_CLAMAV_PLUGIN, test x"$ac_cv_enable_clamav_plugin" = xyes)
  680. dnl Libetpan
  681. AC_MSG_CHECKING([whether to use libetpan])
  682. AC_ARG_ENABLE(libetpan,
  683. [ --disable-libetpan Do not compile IMAP4 support with libetpan],
  684. [ac_cv_enable_libetpan=$enableval], [ac_cv_enable_libetpan=yes])
  685. if test x"$ac_cv_enable_libetpan" = xyes; then
  686. AC_MSG_RESULT(yes)
  687. libetpan_result=no
  688. AC_PATH_PROG(libetpanconfig, [libetpan-config])
  689. if test "x$libetpanconfig" != "x"; then
  690. CPPFLAGS="$CPPFLAGS `$libetpanconfig --cflags 2>/dev/null`"
  691. AC_CHECK_HEADER(libetpan/libetpan.h, [libetpan_result=yes])
  692. if test "x$libetpan_result" = "xyes"; then
  693. AC_MSG_CHECKING([whether libetpan-config hints compiles and links fine])
  694. LIBS="$LIBS `$libetpanconfig --libs 2>/dev/null`"
  695. AC_TRY_LINK([#include <libetpan/dbstorage.h>], [db_mailstorage_init(NULL, NULL);], [libetpan_result=yes], [libetpan_result=no])
  696. AC_MSG_RESULT([$libetpan_result])
  697. fi
  698. fi
  699. if test "x$libetpan_result" = "xyes"; then
  700. LIBETPAN_CPPFLAGS="`$libetpanconfig --cflags`"
  701. LIBETPAN_LIBS="`$libetpanconfig --libs`"
  702. LIBETPAN_VERSION=`$libetpanconfig --version | sed "s/\.//g" | sed "s/-.*$//"`
  703. if test "$LIBETPAN_VERSION" -lt "048"; then
  704. AC_MSG_RESULT([*** Claws Mail requires libetpan 0.48 or newer. See http://www.etpan.org/])
  705. AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 support.])
  706. AC_MSG_ERROR([libetpan 0.48 not found])
  707. fi
  708. AC_SUBST(LIBETPAN_FLAGS)
  709. AC_SUBST(LIBETPAN_LIBS)
  710. AC_DEFINE(HAVE_LIBETPAN, 1, Define if you want IMAP support.)
  711. else
  712. AC_MSG_RESULT([*** Claws Mail requires libetpan 0.48 or newer. See http://www.etpan.org/ ])
  713. AC_MSG_RESULT([*** You can use --disable-libetpan if you don't need IMAP4 support.])
  714. AC_MSG_ERROR([libetpan 0.48 not found])
  715. fi
  716. else
  717. AC_MSG_RESULT(no)
  718. fi
  719. AM_CONDITIONAL(CLAWS_LIBETPAN, test "x$libetpan_result" = "xyes")
  720. dnl Libgnomeprint
  721. AC_MSG_CHECKING([whether to use libgnomeprint])
  722. AC_ARG_ENABLE(gnomeprint,
  723. [ --disable-gnomeprint Do not use libgnomeprint for printing],
  724. [ac_cv_enable_gnomeprint=$enableval], [ac_cv_enable_gnomeprint=yes])
  725. if test x$ac_cv_enable_gnomeprint = xyes; then
  726. AC_MSG_RESULT(yes)
  727. PKG_CHECK_MODULES(GNOMEPRINT, libgnomeprint-2.2 libgnomeprintui-2.2,
  728. ac_cv_enable_gnomeprint=yes, ac_cv_enable_gnomeprint=no)
  729. if test x"$ac_cv_enable_gnomeprint" = xyes; then
  730. AC_DEFINE(USE_GNOMEPRINT, 1, Define if you want libgnomeprint support)
  731. else
  732. AC_MSG_RESULT(not found)
  733. AC_MSG_WARN([*** libgnomeprintui wasn't found ***])
  734. AC_MSG_WARN([*** using built-in printing support ***])
  735. fi
  736. else
  737. AC_MSG_RESULT(no)
  738. fi
  739. AM_CONDITIONAL(CLAWS_GNOMEPRINT, test x"$ac_cv_enable_gnomeprint" = x"yes")
  740. dnl ****************************
  741. dnl ** Final configure output **
  742. dnl ****************************
  743. AC_OUTPUT([
  744. Makefile
  745. m4/Makefile
  746. po/Makefile.in
  747. src/common/version.h
  748. src/Makefile
  749. src/common/Makefile
  750. src/common/passcrypt.h
  751. src/gtk/Makefile
  752. src/etpan/Makefile
  753. src/plugins/Makefile
  754. src/plugins/demo/Makefile
  755. src/plugins/bogofilter/Makefile
  756. src/plugins/spamassassin/Makefile
  757. src/plugins/dillo_viewer/Makefile
  758. src/plugins/trayicon/Makefile
  759. src/plugins/trayicon/libeggtrayicon/Makefile
  760. src/plugins/clamav/Makefile
  761. src/plugins/pgpcore/Makefile
  762. src/plugins/pgpmime/Makefile
  763. src/plugins/pgpinline/Makefile
  764. doc/Makefile
  765. doc/man/Makefile
  766. tools/Makefile
  767. config/Makefile
  768. manual/Makefile
  769. manual/dtd/Makefile
  770. manual/dist/Makefile
  771. manual/dist/pdf/Makefile
  772. manual/dist/ps/Makefile
  773. manual/dist/html/Makefile
  774. manual/dist/txt/Makefile
  775. manual/fr/Makefile
  776. manual/fr/dist/Makefile
  777. manual/fr/dist/pdf/Makefile
  778. manual/fr/dist/ps/Makefile
  779. manual/fr/dist/html/Makefile
  780. manual/fr/dist/txt/Makefile
  781. manual/pl/Makefile
  782. manual/pl/dist/Makefile
  783. manual/pl/dist/pdf/Makefile
  784. manual/pl/dist/ps/Makefile
  785. manual/pl/dist/html/Makefile
  786. manual/pl/dist/txt/Makefile
  787. manual/es/Makefile
  788. manual/es/dist/Makefile
  789. manual/es/dist/pdf/Makefile
  790. manual/es/dist/ps/Makefile
  791. manual/es/dist/html/Makefile
  792. manual/es/dist/txt/Makefile
  793. claws-mail.pc
  794. ])
  795. dnl Output the configuration summary
  796. echo ""
  797. echo "$PACKAGE $VERSION"
  798. echo ""
  799. echo "JPilot : $ac_cv_enable_jpilot"
  800. echo "LDAP : $ac_cv_enable_ldap"
  801. echo "OpenSSL : $ac_cv_enable_openssl"
  802. echo "iconv : $am_cv_func_iconv"
  803. echo "compface : $ac_cv_enable_compface"
  804. echo "IPv6 : $ac_cv_enable_ipv6"
  805. echo "GNU/aspell : $ac_cv_enable_aspell"
  806. echo "IMAP4 : $ac_cv_enable_libetpan"
  807. echo "Crash dialog : $ac_cv_enable_crash_dialog"
  808. echo "Libgnomeprint : $ac_cv_enable_gnomeprint"
  809. echo "LibSM : $ac_cv_enable_libsm"
  810. echo "Manual : $ac_cv_enable_manual"
  811. echo "Plugins : $PLUGINS"
  812. echo "Config dir : $ac_cv_with_config_dir"
  813. echo ""
  814. echo "The binary will be installed in $prefix/bin"
  815. echo ""
  816. echo "Configure finished, type 'make' to build."