configure.ac 28 KB

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