configure.ac 28 KB

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