configure.ac 27 KB

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