configure.ac 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698
  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_PREREQ(2.50)
  3. AC_INIT(src/main.c)
  4. AC_CONFIG_AUX_DIR(config)
  5. PACKAGE=sylpheed-claws
  6. dnl version number
  7. MAJOR_VERSION=1
  8. MINOR_VERSION=9
  9. MICRO_VERSION=12
  10. INTERFACE_AGE=0
  11. BINARY_AGE=0
  12. EXTRA_VERSION=4
  13. EXTRA_RELEASE=
  14. EXTRA_GTK2_VERSION=
  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(SYLPHEED_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(SYLPHEED_GNOME2, test x"$ac_enable_gnome2" = x"yes")
  48. dnl libgnomeprint installed?
  49. PKG_CHECK_MODULES(GNOMEPRINT, libgnomeprint-2.2 libgnomeprintui-2.2, ac_enable_gnomeprint=yes, ac_enable_gnomeprint=no)
  50. AM_CONDITIONAL(SYLPHEED_GNOMEPRINT, test x"$ac_enable_gnomeprint" = x"yes")
  51. if test x$ac_enable_gnomeprint = xyes; then
  52. AC_DEFINE(USE_GNOMEPRINT, 1, Define if you want libgnomeprint support)
  53. fi
  54. dnl Claws version
  55. AC_DEFINE(CLAWS, 1, Compiling Claws branch of sylpheed)
  56. dnl libtool versioning
  57. LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
  58. LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
  59. LT_REVISION=$INTERFACE_AGE
  60. LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
  61. AC_SUBST(LT_RELEASE)
  62. AC_SUBST(LT_CURRENT)
  63. AC_SUBST(LT_REVISION)
  64. AC_SUBST(LT_AGE)
  65. dnl Specify a header configuration file
  66. AC_CONFIG_HEADERS(config.h)
  67. AM_MAINTAINER_MODE
  68. dnl Checks for programs.
  69. dnl AC_ARG_PROGRAM
  70. AC_PROG_CC
  71. AC_ISC_POSIX
  72. AC_PROG_INSTALL
  73. AC_PROG_LN_S
  74. AC_PROG_MAKE_SET
  75. AC_PROG_CPP
  76. dnl AC_PROG_RANLIB
  77. AM_PROG_LEX
  78. AC_PROG_YACC
  79. AC_PROG_LIBTOOL
  80. SYLPHEED_ACLOCAL_INCLUDE(m4)
  81. dnl ******************************
  82. dnl Checks for host
  83. dnl ******************************
  84. AC_CANONICAL_HOST
  85. dnl Copied from the official gtk+-2 configure.in
  86. AC_MSG_CHECKING([for some Win32 platform])
  87. case "$host" in
  88. *-*-mingw*|*-*-cygwin*)
  89. platform_win32=yes
  90. LDFLAGS="$LDFLAGS -mwindows"
  91. ;;
  92. *)
  93. platform_win32=no
  94. ;;
  95. esac
  96. AC_MSG_RESULT([$platform_win32])
  97. AM_CONDITIONAL(PLATFORM_WIN32, test x"$platform_win32" = x"yes")
  98. if test x"$platform_win32" = x"yes"; then
  99. WINDRES=windres
  100. AC_SUBST(WINDRES)
  101. fi
  102. AC_MSG_CHECKING([for native Win32])
  103. case "$host" in
  104. *-*-mingw*)
  105. os_win32=yes
  106. ;;
  107. *)
  108. os_win32=no
  109. ;;
  110. esac
  111. AC_MSG_RESULT([$os_win32])
  112. AM_CONDITIONAL(OS_WIN32, test x"$os_win32" = x"yes")
  113. CFLAGS="$CFLAGS -Wall"
  114. case "$target" in
  115. *-darwin*)
  116. CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
  117. ;;
  118. esac
  119. dnl Checks for iconv
  120. AM_ICONV
  121. dnl
  122. dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
  123. dnl
  124. syl_save_LIBS=$LIBS
  125. LIBS="$LIBS $GTK_LIBS"
  126. AC_CHECK_FUNCS(bind_textdomain_codeset)
  127. LIBS=$syl_save_LIBS
  128. dnl for gettext
  129. ALL_LINGUAS="bg ca cs de el en_GB es fi fr hr hu it ja ko nl pl pt_BR ru sk sr sv zh_CN zh_TW.Big5"
  130. GETTEXT_PACKAGE=sylpheed-claws
  131. AC_SUBST(GETTEXT_PACKAGE)
  132. AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define text domain.])
  133. AM_GLIB_GNU_GETTEXT
  134. dnl AM_GNU_GETTEXT
  135. dnl AC_CHECK_FUNC(gettext, AC_CHECK_LIB(intl, gettext))
  136. localedir='${prefix}/${DATADIRNAME}/locale'
  137. AC_SUBST(localedir)
  138. manualdir='${prefix}/${DATADIRNAME}/${PACKAGE}/manual'
  139. AC_SUBST(manualdir)
  140. faqdir='${prefix}/${DATADIRNAME}/${PACKAGE}/faq'
  141. AC_SUBST(faqdir)
  142. dnl Set PACKAGE_DATA_DIR in config.h.
  143. if test "x${datadir}" = 'x${prefix}/share'; then
  144. if test "x${prefix}" = "xNONE"; then
  145. AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}", PACKAGE_DATA_DIR)
  146. else
  147. AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}", PACKAGE_DATA_DIR)
  148. fi
  149. else
  150. AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datadir}/${PACKAGE}", PACKAGE_DATA_DIR)
  151. fi
  152. AC_CHECK_LIB(xpg4, setlocale)
  153. dnl for GThread support (currently disabled)
  154. dnl AC_ARG_ENABLE(threads,
  155. dnl [ --enable-threads Enable multithread support [default=no]],
  156. dnl [use_threads=$enableval], [use_threads=no])
  157. AC_MSG_CHECKING([whether to use threads])
  158. if test x"$use_threads" = xyes ; then
  159. AC_MSG_RESULT(yes)
  160. if test ! -z `$GLIB_CONFIG --help 2>&1 |grep 'gthread'` ; then
  161. CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
  162. LIBS="$LIBS `$GLIB_CONFIG --libs gthread`"
  163. AC_DEFINE(USE_THREADS, 1, Whether to use multithread or not)
  164. else
  165. AC_MSG_ERROR([Sylpheed requires GThread from GLib to use threading.])
  166. fi
  167. else
  168. AC_MSG_RESULT(no)
  169. fi
  170. dnl Check for d_type member in struct dirent
  171. AC_MSG_CHECKING([whether struct dirent has d_type member])
  172. AC_CACHE_VAL(ac_cv_dirent_d_type,[
  173. AC_TRY_COMPILE([#include <dirent.h>],
  174. [struct dirent d; d.d_type = DT_REG;],
  175. ac_cv_dirent_d_type=yes, ac_cv_dirent_d_type=no)
  176. ])
  177. AC_MSG_RESULT($ac_cv_dirent_d_type)
  178. if test $ac_cv_dirent_d_type = yes; then
  179. AC_DEFINE(HAVE_DIRENT_D_TYPE, 1,
  180. Define if `struct dirent' has `d_type' member.)
  181. fi
  182. dnl Checks for header files.
  183. AC_HEADER_DIRENT
  184. AC_HEADER_STDC
  185. AC_HEADER_SYS_WAIT
  186. AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
  187. sys/param.h sys/utsname.h sys/select.h \
  188. wchar.h wctype.h locale.h)
  189. dnl alf - Check for apache installation f*ck up. apache may also install an
  190. dnl fnmatch, which includes their own regex stuff if USE_HSREGEX is defined
  191. AC_TRY_COMPILE([#include <stdlib.h>
  192. #include <fnmatch.h>],
  193. [int x = USE_HSREGEX;],
  194. ac_cv_have_apache_fnmatch=yes, ac_cv_have_apache_fnmatch=no)
  195. if test $ac_cv_have_apache_fnmatch = yes; then
  196. AC_DEFINE(HAVE_APACHE_FNMATCH, 1, Define if you need to work around apache regex/fnmatch !KLUDGE!)
  197. fi
  198. AC_MSG_CHECKING([whether to use Apache regex header kludge])
  199. AC_MSG_RESULT($ac_cv_have_apache_fnmatch)
  200. dnl Checks for typedefs, structures, and compiler characteristics.
  201. AC_C_CONST
  202. AC_TYPE_OFF_T
  203. AC_TYPE_PID_T
  204. AC_TYPE_SIZE_T
  205. AC_STRUCT_TM
  206. dnl AC_CHECK_TYPE(wint_t, unsigned int) does not work because wint_t
  207. dnl may be defined only in wchar.h (this happens with gcc-2.96).
  208. dnl So we need to use this extended macro.
  209. SYLPHEED_CHECK_TYPE(wint_t, unsigned int,
  210. [
  211. #if HAVE_WCHAR_H
  212. #include <wchar.h>
  213. #endif
  214. ], Define to `unsigned int' if <stddef.h> or <wchar.h> doesn't define.)
  215. GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF, Used to test for a u32 typedef)
  216. AC_CHECK_SIZEOF(unsigned short, 2)
  217. AC_CHECK_SIZEOF(unsigned int, 4)
  218. AC_CHECK_SIZEOF(unsigned long, 4)
  219. dnl Checks for library functions.
  220. AC_FUNC_ALLOCA
  221. AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr strchr \
  222. wcsstr wcswcs iswalnum iswspace towlower \
  223. wcslen wcscpy wcsncpy \
  224. uname flock lockf inet_aton inet_addr \
  225. fchmod mkstemp)
  226. dnl *****************
  227. dnl ** common code **
  228. dnl *****************
  229. dnl check for glib
  230. AM_PATH_GLIB_2_0(2.0.0,,
  231. AC_MSG_ERROR(Test for GLIB failed. See the file 'INSTALL' for help.),
  232. gmodule gobject gthread)
  233. dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
  234. syl_save_LIBS=$LIBS
  235. LIBS="$LIBS $GTK_LIBS"
  236. AC_CHECK_FUNCS(bind_textdomain_codeset)
  237. LIBS=$syl_save_LIBS
  238. dnl check for IPv6 option
  239. AC_ARG_ENABLE(ipv6,
  240. [ --disable-ipv6 Disable IPv6 support],
  241. [ac_cv_enable_ipv6=$enableval], [ac_cv_enable_ipv6=yes])
  242. dnl automated checks for IPv6 support.
  243. AC_MSG_CHECKING([whether to use IPv6])
  244. if test x"$ac_cv_enable_ipv6" = xyes; then
  245. AC_MSG_RESULT(yes)
  246. AC_MSG_CHECKING([for IPv6 support])
  247. AC_CACHE_VAL(ac_cv_ipv6,[
  248. AC_TRY_COMPILE([#define INET6
  249. #include <sys/types.h>
  250. #include <netinet/in.h>],
  251. [int x = IPPROTO_IPV6; struct in6_addr a;],
  252. ac_cv_ipv6=yes, ac_cv_ipv6=no)
  253. ])
  254. AC_MSG_RESULT($ac_cv_ipv6)
  255. if test $ac_cv_ipv6 = yes; then
  256. AC_DEFINE(INET6, 1, Define if you want IPv6 support.)
  257. else
  258. AC_MSG_WARN(*** IPv6 will not be supported ***)
  259. ac_cv_enable_ipv6=no
  260. fi
  261. else
  262. AC_MSG_RESULT(no)
  263. fi
  264. dnl Check for OpenSSL
  265. AC_ARG_ENABLE(openssl,
  266. [ --enable-openssl Attempt to use OpenSSL for SSL support.],
  267. [ac_cv_enable_openssl=$enableval], [ac_cv_enable_openssl=yes])
  268. if test x"$ac_cv_enable_openssl" = xyes; then
  269. PKG_CHECK_MODULES(OPENSSL, openssl >= 0.9.7, :, ac_cv_enable_openssl=no)
  270. if test x$ac_cv_enable_openssl = xyes; then
  271. AC_DEFINE(USE_OPENSSL, 1, Define if you want OpenSSL support)
  272. fi
  273. fi
  274. AC_SUBST(OPENSSL_CFLAGS)
  275. AC_SUBST(OPENSSL_LIBS)
  276. dnl password encryption
  277. OLDLIBS=$LIBS
  278. LIBS=
  279. AC_SEARCH_LIBS(encrypt, crypt, [], AC_MSG_ERROR(['encrypt'-function not found.]))
  280. CRYPT_LIBS=$LIBS
  281. AC_SUBST(CRYPT_LIBS)
  282. LIBS=$OLDLIBS
  283. AC_ARG_WITH(passcrypt-key, [ --with-passcrypt-key=KEY Key used to encode passwords (8 byte string)],
  284. with_passcrypt_key="$withval", with_passcrypt_key="passkey0")
  285. AC_SUBST(PASSCRYPT_KEY, $with_passcrypt_key)
  286. dnl RC dir (will be default at a certain point in time)
  287. AC_ARG_WITH(config-dir, [ --with-config-dir=RCDIR Local configuration dir (default: .sylpheed-gtk2)],
  288. ac_cv_with_config_dir="$withval", ac_cv_with_config_dir=".sylpheed-gtk2")
  289. if test x"$ac_cv_with_config_dir" = x""; then
  290. ac_cv_with_config_dir=".sylpheed-gtk2"
  291. fi
  292. AC_DEFINE_UNQUOTED(CFG_RC_DIR, "$ac_cv_with_config_dir", Configuration directory)
  293. dnl ************************
  294. dnl ** GTK user interface **
  295. dnl ************************
  296. dnl Checks for GTK
  297. AM_PATH_GTK_2_0(2.4.0,,
  298. AC_MSG_ERROR(Test for GTK failed. See the file 'INSTALL' for help.))
  299. dnl --disable-deprecated switch for GTK2 purification
  300. AC_ARG_ENABLE(deprecated, [ --disable-deprecated Disable deprecated GTK functions. ],
  301. [GTK_CFLAGS="$GTK_CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"], [])
  302. AC_SUBST(GTK_CFLAGS)
  303. AC_SUBST(GTK_LIBS)
  304. dnl GNU/Aspell is used for spell checking
  305. AC_ARG_ENABLE(aspell,
  306. [ --enable-aspell Enable GNU/aspell support [default=no]],
  307. [ac_cv_enable_aspell=$enableval], [ac_cv_enable_aspell=no])
  308. AC_MSG_CHECKING([whether to use GNU/aspell])
  309. if test $ac_cv_enable_aspell = yes; then
  310. AC_MSG_RESULT(yes)
  311. AM_PATH_ASPELL(0.50, AC_DEFINE(USE_ASPELL, 1, Define if you use ASPELL to support spell checking),
  312. [use_aspell=no ac_cv_enable_aspell=no])
  313. else
  314. AC_MSG_RESULT(no)
  315. fi
  316. dnl want crash dialog
  317. AC_ARG_ENABLE(crash-dialog,
  318. [ --enable-crash-dialog Enable crash dialog [default=no]],
  319. [ac_cv_enable_crash_dialog=$enableval], [ac_cv_enable_crash_dialog=no])
  320. if test $ac_cv_enable_crash_dialog = yes; then
  321. dnl check if GDB is somewhere
  322. AC_CHECK_PROG(ac_cv_enable_crash_dialog, gdb, yes, no)
  323. AC_MSG_CHECKING([whether to use crash dialog])
  324. if test $ac_cv_enable_crash_dialog = yes; then
  325. AC_DEFINE(CRASH_DIALOG, 1, Pop up crash dialog)
  326. fi
  327. AC_MSG_RESULT($ac_cv_enable_crash_dialog)
  328. fi
  329. dnl Check for X-Face support
  330. AC_ARG_ENABLE(compface,
  331. [ --disable-compface Do not use compface (X-Face)],
  332. [ac_cv_enable_compface=$enableval], [ac_cv_enable_compface=yes])
  333. AC_MSG_CHECKING([whether to use compface])
  334. if test x"$ac_cv_enable_compface" = xyes; then
  335. AC_MSG_RESULT(yes)
  336. AC_CHECK_LIB(compface, uncompface,
  337. [AC_DEFINE(HAVE_LIBCOMPFACE, 1, Define if you want compface support.)],
  338. [ac_cv_enable_compface=no])
  339. if test x"$ac_cv_enable_compface" = xyes; then
  340. COMPFACE_LIBS="-lcompface"
  341. else
  342. COMPFACE_LIBS=""
  343. fi
  344. AC_SUBST(COMPFACE_LIBS)
  345. else
  346. AC_MSG_RESULT(no)
  347. fi
  348. dnl check for pthread support
  349. AC_ARG_ENABLE(pthread,
  350. [ --disable-pthread Disable pthread support],
  351. [ac_cv_enable_pthread=$enableval], [ac_cv_enable_pthread=yes])
  352. AC_MSG_CHECKING([whether to use pthread])
  353. if test x$ac_cv_enable_pthread = xno; then
  354. AC_MSG_RESULT(no)
  355. else
  356. AC_MSG_RESULT(yes)
  357. AC_CHECK_LIB(pthread, pthread_create, :, ac_cv_enable_pthread=no)
  358. AC_CHECK_HEADERS(pthread.h, :, ac_cv_enable_pthread=no)
  359. if test x$ac_cv_enable_pthread = xyes; then
  360. AC_DEFINE(USE_PTHREAD, 1, Define if you have pthread)
  361. PTHREAD_LIBS="-lpthread"
  362. fi
  363. fi
  364. AC_SUBST(PTHREAD_LIBS)
  365. dnl for LDAP support in addressbook
  366. dnl no check for libraries; dynamically loaded
  367. AC_ARG_ENABLE(ldap,
  368. [ --enable-ldap Enable LDAP support [default=no]],
  369. [ac_cv_enable_ldap=$enableval], [ac_cv_enable_ldap=no])
  370. AC_MSG_CHECKING([whether to use LDAP])
  371. if test x"$ac_cv_enable_ldap" = xno; then
  372. AC_MSG_RESULT(no)
  373. elif test x"$ac_cv_enable_ldap" = xyes -a x"$ac_cv_enable_pthread" = xno; then
  374. AC_MSG_RESULT(no - LDAP support needs pthread support)
  375. ac_cv_enable_ldap=no
  376. else
  377. AC_MSG_RESULT(yes)
  378. dnl check for available libraries, and pull them in
  379. AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="$LDAP_LIBS -lresolv")
  380. AC_CHECK_LIB(socket, bind, LDAP_LIBS="$LDAP_LIBS -lsocket")
  381. AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl")
  382. AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS="$LDAP_LIBS -llber",,
  383. $LDAP_LIBS)
  384. AC_CHECK_HEADERS(ldap.h lber.h,
  385. [ ac_cv_enable_ldap=yes ],
  386. [ ac_cv_enable_ldap=no ])
  387. if test "$ac_cv_enable_ldap" = yes; then
  388. AC_CHECK_LIB(ldap, ldap_open,
  389. [ ac_cv_enable_ldap=yes ],
  390. [ ac_cv_enable_ldap=no ],
  391. $LDAP_LIBS)
  392. AC_CHECK_LIB(ldap, ldap_start_tls_s,
  393. [ ac_cv_have_tls=yes ],
  394. [ ac_cv_have_tls=no ])
  395. fi
  396. AC_MSG_CHECKING([whether ldap library is available])
  397. AC_MSG_RESULT($ac_cv_enable_ldap)
  398. AC_MSG_CHECKING([whether TLS library is available])
  399. AC_MSG_RESULT($ac_cv_have_tls)
  400. if test "$ac_cv_enable_ldap" = yes; then
  401. CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
  402. LDAP_LIBS="$LDAP_LIBS -lldap `$GLIB_CONFIG --libs gthread`"
  403. AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
  404. AC_SUBST(LDAP_LIBS)
  405. if test "$ac_cv_have_tls" = yes; then
  406. AC_DEFINE(USE_LDAP_TLS, 1, Define if you want LDAP TLS support in addressbook.)
  407. fi
  408. fi
  409. fi
  410. dnl for JPilot support in addressbook
  411. dnl no check for libraries; these are dynamically loaded
  412. AC_ARG_ENABLE(jpilot,
  413. [ --enable-jpilot Enable JPilot support [default=no]],
  414. [ac_cv_enable_jpilot=$enableval], [ac_cv_enable_jpilot=no])
  415. AC_MSG_CHECKING([whether to use JPilot])
  416. if test "$ac_cv_enable_jpilot" = yes; then
  417. AC_MSG_RESULT(yes)
  418. AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h,
  419. [ AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ],
  420. [ ac_cv_enable_jpilot=no ])
  421. if test "$ac_cv_enable_jpilot" = no; then
  422. AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h,
  423. [ ac_cv_enable_jpilot=yes
  424. AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ])
  425. fi
  426. AC_CHECK_LIB(pisock, unpack_Address, [JPILOT_LIBS="-lpisock"], [JPILOT_LIBS="" ac_cv_enable_jpilot="no"])
  427. if test x"$ac_cv_enable_jpilot" = xyes; then
  428. AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.)
  429. else
  430. AC_MSG_NOTICE([JPilot support not available])
  431. fi
  432. AC_SUBST(JPILOT_LIBS)
  433. else
  434. AC_MSG_RESULT(no)
  435. fi
  436. dnl #######################################################################
  437. dnl # Check for startup notification
  438. dnl #######################################################################
  439. AC_ARG_ENABLE(startup-notification, [ --disable-startup-notification compile without startup notification support],,enable_startup_notification=yes)
  440. if test "x$enable_startup_notification" = "xyes"; then
  441. PKG_CHECK_MODULES(STARTUP_NOTIFICATION, libstartup-notification-1.0 >= 0.5,
  442. [
  443. AC_DEFINE(HAVE_STARTUP_NOTIFICATION, 1, [Define if we're using libstartup-notification.])
  444. echo "Building with libstartup-notification"
  445. enable_startup_notification=yes
  446. ],
  447. [
  448. echo "Building without libstartup-notification"
  449. enable_startup_notification=no
  450. ])
  451. AC_SUBST(STARTUP_NOTIFICATION_CFLAGS)
  452. AC_SUBST(STARTUP_NOTIFICATION_LIBS)
  453. fi
  454. dnl *************************
  455. dnl ** section for plugins **
  456. dnl *************************
  457. PLUGINS=""
  458. dnl --- Trayicon ---
  459. AC_ARG_ENABLE(trayicon-plugin,
  460. [ --disable-trayicon-plugin Do not build System Tray Icon plugin],
  461. [ac_cv_enable_trayicon_plugin=$enableval], [ac_cv_enable_trayicon_plugin=yes])
  462. if test x"$ac_cv_enable_trayicon_plugin" = xyes; then
  463. PLUGINS="trayicon $PLUGINS"
  464. fi
  465. AM_CONDITIONAL(BUILD_TRAYICON_PLUGIN, test x"$ac_cv_enable_trayicon_plugin" = xyes)
  466. dnl --- SpamAssassin ---
  467. AC_ARG_ENABLE(spamassassin-plugin,
  468. [ --enable-spamassassin-plugin Build SpamAssassin plugin [default=no]],
  469. [ac_cv_enable_spamassassin_plugin=$enableval], [ac_cv_enable_spamassassin_plugin=no])
  470. if test x"$ac_cv_enable_spamassassin_plugin" = xyes; then
  471. AC_SPAMASSASSIN
  472. PLUGINS="spamassassin $PLUGINS"
  473. fi
  474. AM_CONDITIONAL(BUILD_SPAMASSASSIN_PLUGIN, test x"$ac_cv_enable_spamassassin_plugin" = xyes)
  475. dnl --- PGP/MIME ---
  476. AC_ARG_ENABLE(pgpmime-plugin,
  477. [ --disable-pgpmime-plugin Do not build PGP/MIME plugin],
  478. [ac_cv_enable_pgpmime_plugin=$enableval], [ac_cv_enable_pgpmime_plugin=yes])
  479. if test x"$ac_cv_enable_pgpmime_plugin" = xyes; then
  480. AM_PATH_GPGME(0.3.10, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.),
  481. [ac_cv_enable_pgpmime_plugin=no])
  482. if test x"$ac_cv_enable_pgpmime_plugin" = xyes; then
  483. PLUGINS="pgpmime $PLUGINS"
  484. fi
  485. fi
  486. AM_CONDITIONAL(BUILD_PGPMIME_PLUGIN, test x"$ac_cv_enable_pgpmime_plugin" = xyes)
  487. dnl --- MathML Viewer ---
  488. AC_ARG_ENABLE(mathml-viewer-plugin,
  489. [ --disable-mathml-viewer-plugin Do not build MathML-Viewer plugin],
  490. [ac_cv_enable_mathml_viewer_plugin=$enableval], [ac_cv_enable_mathml_viewer_plugin=yes])
  491. if test x"$ac_cv_enable_mathml_viewer_plugin" = xyes; then
  492. PKG_CHECK_MODULES(GTK_MATH_VIEW, gtkmathview >= 0.5, :, ac_cv_enable_mathml_viewer_plugin=no)
  493. if test x"$ac_cv_enable_mathml_viewer_plugin" = xyes; then
  494. PLUGINS="mathml-viewer $PLUGINS"
  495. fi
  496. fi
  497. AC_SUBST(GTK_MATH_VIEW_CFLAGS)
  498. AC_SUBST(GTK_MATH_VIEW_LIBS)
  499. AM_CONDITIONAL(BUILD_MATHML_VIEWER_PLUGIN, test x"$ac_cv_enable_mathml_viewer_plugin" = xyes)
  500. dnl --- Dillo Viewer ---
  501. AC_ARG_ENABLE(dillo-viewer-plugin,
  502. [ --disable-dillo-viewer-plugin Do not build Dillo plugin for html mail rendering],
  503. [ac_cv_enable_dillo_viewer_plugin=$enableval], [ac_cv_enable_dillo_viewer_plugin=yes])
  504. if test x"$ac_cv_enable_dillo_viewer_plugin" = xyes; then
  505. PLUGINS="dillo-viewer $PLUGINS"
  506. fi
  507. AM_CONDITIONAL(BUILD_DILLO_VIEWER_PLUGIN, test x"$ac_cv_enable_dillo_viewer_plugin" = xyes)
  508. dnl --- Demo ---
  509. AC_ARG_ENABLE(demo-plugin,
  510. [ --enable-demo-plugin Build demo plugin [default=no]],
  511. [ac_cv_enable_demo_plugin=$enableval], [ac_cv_enable_demo_plugin=no])
  512. if test x"$ac_cv_enable_demo_plugin" = xyes; then
  513. PLUGINS="demo $PLUGINS"
  514. fi
  515. AM_CONDITIONAL(BUILD_DEMO_PLUGIN, test x"$ac_cv_enable_demo_plugin" = xyes)
  516. dnl --- ClamAV ---
  517. AC_ARG_ENABLE(clamav-plugin,
  518. [ --disable-clamav-plugin Do not build Clam AntiVirus plugin],
  519. [ac_cv_enable_clamav_plugin=$enableval], [ac_cv_enable_clamav_plugin=yes])
  520. if test x"$ac_cv_enable_clamav_plugin" = xyes; then
  521. AC_CHECK_LIB(clamav, cl_scanfile, clamav_lib=-lclamav, ac_cv_enable_clamav_plugin=no)
  522. AC_CHECK_HEADERS(clamav.h, :, ac_cv_enable_clamav_plugin=no)
  523. if test x"$ac_cv_enable_clamav_plugin" = xyes; then
  524. CLAMAV_LIBS="${clamav_lib}"
  525. PLUGINS="clamav $PLUGINS"
  526. else
  527. AC_MSG_NOTICE([clamav library not found, will not build clamav plugin])
  528. fi
  529. fi
  530. AC_SUBST(CLAMAV_LIBS)
  531. AM_CONDITIONAL(BUILD_CLAMAV_PLUGIN, test x"$ac_cv_enable_clamav_plugin" = xyes)
  532. dnl Libetpan
  533. libetpan=no
  534. AC_PATH_PROG(libetpanconfig, [libetpan-config])
  535. if test "x$libetpanconfig" != "x"; then
  536. CPPFLAGS="$CPPFLAGS `$libetpanconfig --cflags 2>/dev/null`"
  537. AC_CHECK_HEADER(libetpan/libetpan.h, [libetpan=yes])
  538. if test "x$libetpan" = "xyes"; then
  539. AC_MSG_CHECKING([whether libetpan-config hints compiles and links fine])
  540. LDFLAGS="$LDFLAGS `$libetpanconfig --libs 2>/dev/null`"
  541. AC_TRY_LINK([], [db_mailstorage_init();], [libetpan=yes], [libetpan=no])
  542. AC_MSG_RESULT([$libetpan])
  543. fi
  544. fi
  545. if test "x$libetpan" = "xyes"; then
  546. LIBETPAN_CPPFLAGS="`$libetpanconfig --cflags`"
  547. LIBETPAN_LIBS="`$libetpanconfig --libs`"
  548. fi
  549. AC_SUBST(LIBETPAN_FLAGS)
  550. AC_SUBST(LIBETPAN_LIBS)
  551. dnl ****************************
  552. dnl ** Final configure output **
  553. dnl ****************************
  554. AC_OUTPUT([
  555. Makefile
  556. sylpheed.spec
  557. m4/Makefile
  558. po/Makefile.in
  559. src/common/version.h
  560. src/Makefile
  561. src/common/Makefile
  562. src/common/passcrypt.h
  563. src/gtk/Makefile
  564. src/etpan/Makefile
  565. src/plugins/Makefile
  566. src/plugins/demo/Makefile
  567. src/plugins/spamassassin/Makefile
  568. src/plugins/mathml_viewer/Makefile
  569. src/plugins/dillo_viewer/Makefile
  570. src/plugins/trayicon/Makefile
  571. src/plugins/trayicon/libeggtrayicon/Makefile
  572. src/plugins/clamav/Makefile
  573. src/plugins/pgpmime/Makefile
  574. doc/Makefile
  575. doc/faq/Makefile
  576. doc/faq/de/Makefile
  577. doc/faq/en/Makefile
  578. doc/faq/es/Makefile
  579. doc/faq/fr/Makefile
  580. doc/faq/it/Makefile
  581. doc/man/Makefile
  582. doc/manual/Makefile
  583. doc/manual/de/Makefile
  584. doc/manual/en/Makefile
  585. doc/manual/es/Makefile
  586. doc/manual/fr/Makefile
  587. doc/manual/ja/Makefile
  588. tools/Makefile
  589. config/Makefile
  590. sylpheed-claws.pc
  591. ])
  592. dnl Output the configuration summary
  593. echo ""
  594. echo "$PACKAGE $VERSION"
  595. echo ""
  596. echo "JPilot : $ac_cv_enable_jpilot"
  597. echo "LDAP : $ac_cv_enable_ldap"
  598. echo "OpenSSL : $ac_cv_enable_openssl"
  599. echo "iconv : $am_cv_func_iconv"
  600. echo "compface : $ac_cv_enable_compface"
  601. echo "IPv6 : $ac_cv_enable_ipv6"
  602. echo "GNU/aspell : $ac_cv_enable_aspell"
  603. echo "Crash dialog : $ac_cv_enable_crash_dialog"
  604. echo "Plugins : $PLUGINS"
  605. echo "Config dir : $ac_cv_with_config_dir"
  606. echo ""
  607. echo "The binary will be installed in $prefix/bin"
  608. echo ""
  609. echo "Configure finished, type 'make' to build."