configure.ac 21 KB

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