diff options
| author | Simeon Simeonov | 2018-02-26 11:23:00 +0100 |
|---|---|---|
| committer | Simeon Simeonov | 2018-02-26 11:23:00 +0100 |
| commit | 0b3cbf57875fd692e4ba0b336fefa4bee1ed00dc (patch) | |
| tree | af916a30553c78ce9d4f2d8658656a175c5b6921 /configure.ac | |
Initial commit for sylpheed 3.7.0
Diffstat (limited to 'configure.ac')
| -rw-r--r-- | configure.ac | 542 |
1 files changed, 542 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..090177d --- /dev/null +++ b/configure.ac | |||
| @@ -0,0 +1,542 @@ | |||
| 1 | dnl Process this file with autoconf to produce a configure script. | ||
| 2 | AC_PREREQ(2.50) | ||
| 3 | AC_INIT(src/main.c) | ||
| 4 | PACKAGE=sylpheed | ||
| 5 | |||
| 6 | dnl version number | ||
| 7 | MAJOR_VERSION=3 | ||
| 8 | MINOR_VERSION=7 | ||
| 9 | MICRO_VERSION=0 | ||
| 10 | INTERFACE_AGE=0 | ||
| 11 | BINARY_AGE=0 | ||
| 12 | EXTRA_VERSION= | ||
| 13 | BUILD_REVISION=1185 | ||
| 14 | VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION | ||
| 15 | |||
| 16 | dnl define if this is a development release | ||
| 17 | dnl DEVEL_VERSION=1 | ||
| 18 | |||
| 19 | dnl set $target | ||
| 20 | AC_CANONICAL_SYSTEM | ||
| 21 | |||
| 22 | dnl | ||
| 23 | AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define) | ||
| 24 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) | ||
| 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 | AC_SUBST(BUILD_REVISION) | ||
| 34 | |||
| 35 | dnl development or release version | ||
| 36 | AC_SUBST(DEVEL_VERSION) | ||
| 37 | if test "x$DEVEL_VERSION" != "x"; then | ||
| 38 | AC_DEFINE(DEVEL_VERSION, 1, [Define if this is a development release]) | ||
| 39 | fi | ||
| 40 | |||
| 41 | dnl libtool versioning | ||
| 42 | LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION | ||
| 43 | dnl LT_CURRENT=`expr 1 + $MICRO_VERSION - $INTERFACE_AGE` | ||
| 44 | dnl LT_REVISION=$INTERFACE_AGE | ||
| 45 | dnl LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE` | ||
| 46 | LT_CURRENT=4 | ||
| 47 | LT_REVISION=0 | ||
| 48 | LT_AGE=3 | ||
| 49 | AC_SUBST(LT_RELEASE) | ||
| 50 | AC_SUBST(LT_CURRENT) | ||
| 51 | AC_SUBST(LT_REVISION) | ||
| 52 | AC_SUBST(LT_AGE) | ||
| 53 | |||
| 54 | dnl Specify a header configuration file | ||
| 55 | AM_CONFIG_HEADER(config.h) | ||
| 56 | |||
| 57 | AM_MAINTAINER_MODE | ||
| 58 | |||
| 59 | dnl Checks for programs. | ||
| 60 | dnl AC_ARG_PROGRAM | ||
| 61 | AC_PROG_CC | ||
| 62 | AM_DISABLE_STATIC | ||
| 63 | AC_ISC_POSIX | ||
| 64 | AM_PROG_CC_STDC | ||
| 65 | AC_PROG_INSTALL | ||
| 66 | AC_PROG_LN_S | ||
| 67 | AC_PROG_MAKE_SET | ||
| 68 | AC_PROG_CPP | ||
| 69 | dnl AC_PROG_RANLIB | ||
| 70 | AM_PROG_LEX | ||
| 71 | AC_PROG_YACC | ||
| 72 | AM_PROG_LIBTOOL | ||
| 73 | |||
| 74 | SYLPHEED_ACLOCAL_INCLUDE(ac) | ||
| 75 | |||
| 76 | native_win32=no | ||
| 77 | os_osx=no | ||
| 78 | |||
| 79 | case "$target" in | ||
| 80 | *-darwin*) | ||
| 81 | os_osx=yes | ||
| 82 | CFLAGS="$CFLAGS -no-cpp-precomp -fno-common" | ||
| 83 | LIBSYLPH_CFLAGS="$LIBSYLPH_CFLAGS -xobjective-c" | ||
| 84 | ;; | ||
| 85 | *-*-mingw*) | ||
| 86 | native_win32=yes | ||
| 87 | CFLAGS="$CFLAGS -mms-bitfields -mwindows" | ||
| 88 | LIBS="$LIBS" | ||
| 89 | LIBSYLPH_LIBS="-lws2_32 -lwinmm" | ||
| 90 | SYLPHEED_LIBS="-lole32 -Wl,-luuid" | ||
| 91 | AC_CHECK_PROG(WINDRES, windres, windres) | ||
| 92 | ;; | ||
| 93 | esac | ||
| 94 | |||
| 95 | AC_SUBST(LIBSYLPH_CFLAGS) | ||
| 96 | AC_SUBST(LIBSYLPH_LIBS) | ||
| 97 | |||
| 98 | AM_CONDITIONAL(NATIVE_WIN32, test "$native_win32" = "yes") | ||
| 99 | |||
| 100 | dnl Checks for libraries. | ||
| 101 | AM_PATH_GLIB_2_0(2.8.0,, AC_MSG_ERROR(Test for GLib failed. See the 'INSTALL' for help.), gobject gmodule) | ||
| 102 | |||
| 103 | AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal) | ||
| 104 | |||
| 105 | AM_PATH_GTK_2_0(2.8.0,, AC_MSG_ERROR(Test for Gtk failed. See the 'INSTALL' for help.)) | ||
| 106 | |||
| 107 | dnl --disable-deprecated switch for GTK2 purification | ||
| 108 | AC_ARG_ENABLE(deprecated, [ --disable-deprecated Disable deprecated GTK functions. ], | ||
| 109 | [GTK_CFLAGS="$GTK_CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"], []) | ||
| 110 | |||
| 111 | AC_SUBST(GTK_CFLAGS) | ||
| 112 | AC_SUBST(GTK_LIBS) | ||
| 113 | |||
| 114 | if test "$os_osx" == yes; then | ||
| 115 | AC_CHECK_LIB(gtkmacintegration, gtkosx_application_ready, [ ac_have_gtkmacintegration=yes ], [ ac_have_gtkmacintegration=no ]) | ||
| 116 | AC_MSG_CHECKING([if gtkmacintegration is available]) | ||
| 117 | AC_MSG_RESULT($ac_have_gtkmacintegration) | ||
| 118 | if test "$ac_have_gtkmacintegration" = yes; then | ||
| 119 | SYLPHEED_LIBS="$SYLPHEED_LIBS -lgtkmacintegration" | ||
| 120 | AC_DEFINE(USE_GTKMACINTEGRATION, 1, Define if you use gtkmacintegration library.) | ||
| 121 | fi | ||
| 122 | fi | ||
| 123 | |||
| 124 | AC_SUBST(SYLPHEED_LIBS) | ||
| 125 | |||
| 126 | dnl checks for iconv | ||
| 127 | AM_ICONV | ||
| 128 | |||
| 129 | AC_CHECK_FUNCS(bind_textdomain_codeset) | ||
| 130 | |||
| 131 | dnl for gettext | ||
| 132 | ALL_LINGUAS="be bg cs da de el es et eu fi fr gl he hr hu it ja ko lt nl pl pt_BR ro ru sk sl sr sv tr uk vi zh_CN zh_TW" | ||
| 133 | GETTEXT_PACKAGE=sylpheed | ||
| 134 | AC_SUBST(GETTEXT_PACKAGE) | ||
| 135 | AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define text domain.]) | ||
| 136 | |||
| 137 | AM_GLIB_GNU_GETTEXT | ||
| 138 | dnl AM_GNU_GETTEXT | ||
| 139 | dnl AC_CHECK_FUNC(gettext, AC_CHECK_LIB(intl, gettext)) | ||
| 140 | |||
| 141 | if test "x$DATADIRNAME" != "x"; then | ||
| 142 | localedir='${prefix}/${DATADIRNAME}/locale' | ||
| 143 | else | ||
| 144 | localedir='${datadir}/locale' | ||
| 145 | fi | ||
| 146 | AC_ARG_WITH(localedir, | ||
| 147 | [ --with-localedir=DIR Locale directory], | ||
| 148 | [localedir="$withval"]) | ||
| 149 | AC_SUBST(localedir) | ||
| 150 | |||
| 151 | manualdir='${datadir}/${PACKAGE}/manual' | ||
| 152 | AC_ARG_WITH(manualdir, | ||
| 153 | [ --with-manualdir=DIR Manual directory], | ||
| 154 | [manualdir="$withval"]) | ||
| 155 | AC_SUBST(manualdir) | ||
| 156 | |||
| 157 | faqdir='${datadir}/${PACKAGE}/faq' | ||
| 158 | AC_ARG_WITH(faqdir, | ||
| 159 | [ --with-faqdir=DIR FAQ directory], | ||
| 160 | [faqdir="$withval"]) | ||
| 161 | AC_SUBST(faqdir) | ||
| 162 | |||
| 163 | plugindir='${exec_prefix}/lib/${PACKAGE}/plugins' | ||
| 164 | AC_ARG_WITH(plugindir, | ||
| 165 | [ --with-plugindir=DIR Plug-in directory], | ||
| 166 | [plugindir="$withval"]) | ||
| 167 | AC_SUBST(plugindir) | ||
| 168 | |||
| 169 | themedir='${datadir}/${PACKAGE}/icons' | ||
| 170 | AC_ARG_WITH(themedir, | ||
| 171 | [ --with-themedir=DIR Icon theme directory], | ||
| 172 | [themedir="$withval"]) | ||
| 173 | AC_SUBST(themedir) | ||
| 174 | |||
| 175 | dnl GPGME is used to support OpenPGP | ||
| 176 | AC_ARG_ENABLE(gpgme, | ||
| 177 | [ --disable-gpgme Disable GnuPG support using GPGME], | ||
| 178 | [ac_cv_enable_gpgme=$enableval], [ac_cv_enable_gpgme=yes]) | ||
| 179 | AC_MSG_CHECKING([whether to use GPGME]) | ||
| 180 | if test $ac_cv_enable_gpgme = yes; then | ||
| 181 | AC_MSG_RESULT(yes) | ||
| 182 | AM_PATH_GPGME(1.0.0, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.), | ||
| 183 | [use_gpgme=no | ||
| 184 | ac_cv_enable_gpgme=no]) | ||
| 185 | if test $ac_cv_enable_gpgme = yes; then | ||
| 186 | AC_CHECK_LIB(gpgme, gpgme_io_writen, AC_DEFINE(HAVE_GPGME_IO_WRITEN, 1, Define if GPGME has gpgme_io_writen function.)) | ||
| 187 | fi | ||
| 188 | else | ||
| 189 | AC_MSG_RESULT(no) | ||
| 190 | fi | ||
| 191 | |||
| 192 | dnl for JPilot support in addressbook | ||
| 193 | dnl no check for libraries; these are dynamically loaded | ||
| 194 | AC_ARG_ENABLE(jpilot, | ||
| 195 | [ --enable-jpilot Enable JPilot support [[default=no]]], | ||
| 196 | [ac_cv_enable_jpilot=$enableval], [ac_cv_enable_jpilot=no]) | ||
| 197 | AC_MSG_CHECKING([whether to use JPilot]) | ||
| 198 | if test "$ac_cv_enable_jpilot" = yes; then | ||
| 199 | AC_MSG_RESULT(yes) | ||
| 200 | AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h, | ||
| 201 | [ AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ], | ||
| 202 | [ ac_cv_enable_jpilot=no ]) | ||
| 203 | if test "$ac_cv_enable_jpilot" = no; then | ||
| 204 | AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h, | ||
| 205 | [ ac_cv_enable_jpilot=yes | ||
| 206 | AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ]) | ||
| 207 | fi | ||
| 208 | AC_MSG_CHECKING([whether jpilot is available]) | ||
| 209 | AC_MSG_RESULT($ac_cv_enable_jpilot) | ||
| 210 | |||
| 211 | if test "$ac_cv_enable_jpilot" = yes; then | ||
| 212 | LIBS="$LIBS -lpisock" | ||
| 213 | fi | ||
| 214 | else | ||
| 215 | AC_MSG_RESULT(no) | ||
| 216 | fi | ||
| 217 | |||
| 218 | dnl for LDAP support in addressbook | ||
| 219 | dnl no check for libraries; dynamically loaded | ||
| 220 | AC_ARG_ENABLE(ldap, | ||
| 221 | [ --enable-ldap Enable LDAP support [[default=no]]], | ||
| 222 | [ac_cv_enable_ldap=$enableval], [ac_cv_enable_ldap=no]) | ||
| 223 | AC_MSG_CHECKING([whether to use LDAP]) | ||
| 224 | if test "$ac_cv_enable_ldap" = yes; then | ||
| 225 | AC_MSG_RESULT(yes) | ||
| 226 | |||
| 227 | dnl check for available libraries, and pull them in | ||
| 228 | AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="$LDAP_LIBS -lresolv") | ||
| 229 | AC_CHECK_LIB(socket, bind, LDAP_LIBS="$LDAP_LIBS -lsocket") | ||
| 230 | AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl") | ||
| 231 | AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS="$LDAP_LIBS -llber",, | ||
| 232 | $LDAP_LIBS) | ||
| 233 | |||
| 234 | dnl we need libpthread for sylpheed ldap, until we find | ||
| 235 | dnl a better way to handle ldap requests asynchronously... | ||
| 236 | AC_CHECK_LIB(pthread, pthread_create, LDAP_LIBS="$LDAP_LIBS -lpthread") | ||
| 237 | |||
| 238 | AC_CHECK_HEADERS(ldap.h lber.h pthread.h, | ||
| 239 | [ ac_cv_enable_ldap=yes ], | ||
| 240 | [ ac_cv_enable_ldap=no ]) | ||
| 241 | |||
| 242 | if test "$ac_cv_enable_ldap" = yes; then | ||
| 243 | AC_CHECK_LIB(ldap, ldap_open, | ||
| 244 | [ ac_cv_enable_ldap=yes ], | ||
| 245 | [ ac_cv_enable_ldap=no ], | ||
| 246 | $LDAP_LIBS) | ||
| 247 | fi | ||
| 248 | |||
| 249 | AC_MSG_CHECKING([whether ldap library is available]) | ||
| 250 | AC_MSG_RESULT($ac_cv_enable_ldap) | ||
| 251 | |||
| 252 | if test "$ac_cv_enable_ldap" = yes; then | ||
| 253 | CFLAGS="$CFLAGS `$PKG_CONFIG --cflags gthread-2.0`" | ||
| 254 | LDAP_LIBS="$LDAP_LIBS -lldap `$PKG_CONFIG --libs gthread-2.0`" | ||
| 255 | AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.) | ||
| 256 | AC_DEFINE(USE_THREADS, 1, Whether to use multithread or not) | ||
| 257 | AC_SUBST(LDAP_LIBS) | ||
| 258 | fi | ||
| 259 | else | ||
| 260 | AC_MSG_RESULT(no) | ||
| 261 | fi | ||
| 262 | |||
| 263 | dnl Check for OpenSSL | ||
| 264 | AC_ARG_ENABLE(ssl, | ||
| 265 | [ --disable-ssl Disable SSL support using OpenSSL], | ||
| 266 | [ac_cv_enable_ssl=$enableval], [ac_cv_enable_ssl=yes]) | ||
| 267 | AC_MSG_CHECKING([whether to use OpenSSL]) | ||
| 268 | if test $ac_cv_enable_ssl = yes; then | ||
| 269 | AC_MSG_RESULT(yes) | ||
| 270 | dnl First check with pkg-config | ||
| 271 | PKG_CHECK_MODULES(OPENSSL, openssl, [:], [:]) | ||
| 272 | if test "x$OPENSSL_LIBS" != "x"; then | ||
| 273 | CFLAGS="$CFLAGS $OPENSSL_CFLAGS" | ||
| 274 | LIBS="$LIBS $OPENSSL_LIBS" | ||
| 275 | AC_MSG_CHECKING([if openssl is available]) | ||
| 276 | AC_MSG_RESULT(yes) | ||
| 277 | AC_DEFINE(USE_SSL, 1, Define if you use OpenSSL to support SSL.) | ||
| 278 | else | ||
| 279 | dnl If pkg-config fails, run compile/link test. | ||
| 280 | AC_MSG_CHECKING([if openssl is available]) | ||
| 281 | ac_save_LIBS="$LIBS" | ||
| 282 | if test "$native_win32" = yes; then | ||
| 283 | LIBS="$LIBS -lssl32 -leay32" | ||
| 284 | else | ||
| 285 | LIBS="$LIBS -lssl -lcrypto" | ||
| 286 | fi | ||
| 287 | AC_TRY_LINK([ | ||
| 288 | #include <openssl/opensslv.h> | ||
| 289 | ], [ return OPENSSL_VERSION_NUMBER; ], | ||
| 290 | [ AC_MSG_RESULT(yes) | ||
| 291 | AC_DEFINE(USE_SSL, 1, Define if you use OpenSSL to support SSL.) ], | ||
| 292 | [ AC_MSG_RESULT(no) | ||
| 293 | LIBS="$ac_save_LIBS" | ||
| 294 | ac_cv_enable_ssl=no ]) | ||
| 295 | fi | ||
| 296 | else | ||
| 297 | AC_MSG_RESULT(no) | ||
| 298 | fi | ||
| 299 | |||
| 300 | dnl Check for X-Face support | ||
| 301 | AC_ARG_ENABLE(compface, | ||
| 302 | [ --disable-compface Do not use compface (X-Face)], | ||
| 303 | [ac_cv_enable_compface=$enableval], [ac_cv_enable_compface=yes]) | ||
| 304 | if test "$ac_cv_enable_compface" = yes; then | ||
| 305 | AC_CHECK_LIB(compface, uncompface,,[ac_cv_enable_compface=no]) | ||
| 306 | fi | ||
| 307 | |||
| 308 | dnl Check for GtkSpell support | ||
| 309 | AC_MSG_CHECKING([whether to use GtkSpell]) | ||
| 310 | AC_ARG_ENABLE(gtkspell, | ||
| 311 | [ --disable-gtkspell Do not use GtkSpell in editor], | ||
| 312 | [ac_cv_enable_gtkspell=$enableval], [ac_cv_enable_gtkspell=yes]) | ||
| 313 | if test "$ac_cv_enable_gtkspell" = yes; then | ||
| 314 | AC_MSG_RESULT(yes) | ||
| 315 | AC_MSG_CHECKING([whether GtkSpell is available]) | ||
| 316 | if $PKG_CONFIG gtkspell-2.0 ; then | ||
| 317 | AC_MSG_RESULT(yes) | ||
| 318 | CFLAGS="$CFLAGS `$PKG_CONFIG --cflags gtkspell-2.0`" | ||
| 319 | LIBS="$LIBS `$PKG_CONFIG --libs gtkspell-2.0`" | ||
| 320 | if $PKG_CONFIG --atleast-version 2.0.13 gtkspell-2.0 ; then | ||
| 321 | AC_DEFINE(USE_ENCHANT, 1, Use Enchant with GtkSpell) | ||
| 322 | LIBS="$LIBS `$PKG_CONFIG --libs enchant`" | ||
| 323 | |||
| 324 | dnl Workaroud for zemberek crash | ||
| 325 | if $PKG_CONFIG --atleast-version 1.4.2 enchant ; then | ||
| 326 | CFLAGS="$CFLAGS `$PKG_CONFIG --cflags dbus-glib-1`" | ||
| 327 | LIBS="$LIBS `$PKG_CONFIG --libs dbus-glib-1`" | ||
| 328 | fi | ||
| 329 | elif $PKG_CONFIG --atleast-version 2.0.12 gtkspell-2.0 ; then | ||
| 330 | LIBS="$LIBS -laspell" | ||
| 331 | fi | ||
| 332 | AC_DEFINE(USE_GTKSPELL, 1, Use GtkSpell in editor) | ||
| 333 | else | ||
| 334 | AC_MSG_RESULT(no) | ||
| 335 | ac_cv_enable_gtkspell=no | ||
| 336 | fi | ||
| 337 | else | ||
| 338 | AC_MSG_RESULT(no) | ||
| 339 | fi | ||
| 340 | |||
| 341 | dnl Check for Oniguruma support in message filtering | ||
| 342 | AC_ARG_ENABLE(oniguruma, | ||
| 343 | [ --enable-oniguruma Use Oniguruma instead of system's regex [[default=no]]], | ||
| 344 | [ac_cv_enable_oniguruma=$enableval], [ac_cv_enable_oniguruma=no]) | ||
| 345 | AC_MSG_CHECKING([whether to use Oniguruma]) | ||
| 346 | if test "$ac_cv_enable_oniguruma" = yes; then | ||
| 347 | AC_MSG_RESULT(yes) | ||
| 348 | AC_MSG_CHECKING([whether Oniguruma is available]) | ||
| 349 | dnl AC_CHECK_PROG(ONIG_CONFIG, onig-config, onig-config) | ||
| 350 | ONIG_CONFIG=onig-config | ||
| 351 | ONIG_VERSION=`$ONIG_CONFIG --version 2>/dev/null` | ||
| 352 | if test "x$ONIG_VERSION" != "x"; then | ||
| 353 | AC_MSG_RESULT(yes) | ||
| 354 | CFLAGS="$CFLAGS `$ONIG_CONFIG --cflags`" | ||
| 355 | LIBS="$LIBS `$ONIG_CONFIG --libs`" | ||
| 356 | AC_DEFINE(USE_ONIGURUMA, 1, Define if you want to use Oniguruma.) | ||
| 357 | else | ||
| 358 | AC_MSG_RESULT(no) | ||
| 359 | ac_cv_enable_oniguruma=no | ||
| 360 | fi | ||
| 361 | else | ||
| 362 | AC_MSG_RESULT(no) | ||
| 363 | fi | ||
| 364 | |||
| 365 | dnl check additional libraries | ||
| 366 | AC_CHECK_LIB(xpg4, setlocale) | ||
| 367 | AC_CHECK_LIB(resolv, res_init) | ||
| 368 | AC_CHECK_LIB(socket, bind) | ||
| 369 | AC_CHECK_LIB(nsl, gethostbyname) | ||
| 370 | |||
| 371 | dnl for GThread support | ||
| 372 | AC_ARG_ENABLE(threads, | ||
| 373 | [ --disable-threads Disable multithread support], | ||
| 374 | [use_threads=$enableval], [use_threads=yes]) | ||
| 375 | |||
| 376 | AC_MSG_CHECKING([whether to use threads]) | ||
| 377 | if test x"$use_threads" = xyes ; then | ||
| 378 | AC_MSG_RESULT(yes) | ||
| 379 | if $PKG_CONFIG --exists gthread-2.0 ; then | ||
| 380 | CFLAGS="$CFLAGS `$PKG_CONFIG --cflags gthread-2.0`" | ||
| 381 | LIBS="$LIBS `$PKG_CONFIG --libs gthread-2.0`" | ||
| 382 | AC_DEFINE(USE_THREADS, 1, Whether to use multithread or not) | ||
| 383 | else | ||
| 384 | AC_MSG_ERROR([Sylpheed requires GThread from GLib to enable threading.]) | ||
| 385 | fi | ||
| 386 | else | ||
| 387 | AC_MSG_RESULT(no) | ||
| 388 | fi | ||
| 389 | |||
| 390 | dnl check for IPv6 option | ||
| 391 | AC_ARG_ENABLE(ipv6, | ||
| 392 | [ --disable-ipv6 Disable IPv6 support], | ||
| 393 | [ac_cv_enable_ipv6=$enableval], [ac_cv_enable_ipv6=yes]) | ||
| 394 | |||
| 395 | dnl automated checks for IPv6 support. | ||
| 396 | AC_MSG_CHECKING([whether to use IPv6]) | ||
| 397 | if test x"$ac_cv_enable_ipv6" = xyes; then | ||
| 398 | AC_MSG_RESULT(yes) | ||
| 399 | AC_MSG_CHECKING([for IPv6 support]) | ||
| 400 | if test "$native_win32" = yes; then | ||
| 401 | AC_CACHE_VAL(ac_cv_ipv6,[ | ||
| 402 | AC_TRY_COMPILE([#define INET6 | ||
| 403 | #include <sys/types.h> | ||
| 404 | #include <winsock2.h> | ||
| 405 | #include <ws2tcpip.h>], | ||
| 406 | [int x = IPPROTO_IPV6; struct in6_addr a;], | ||
| 407 | ac_cv_ipv6=yes, ac_cv_ipv6=no) | ||
| 408 | ]) | ||
| 409 | else | ||
| 410 | AC_CACHE_VAL(ac_cv_ipv6,[ | ||
| 411 | AC_TRY_COMPILE([#define INET6 | ||
| 412 | #include <sys/types.h> | ||
| 413 | #include <netinet/in.h>], | ||
| 414 | [int x = IPPROTO_IPV6; struct in6_addr a;], | ||
| 415 | ac_cv_ipv6=yes, ac_cv_ipv6=no) | ||
| 416 | ]) | ||
| 417 | fi | ||
| 418 | AC_MSG_RESULT($ac_cv_ipv6) | ||
| 419 | if test $ac_cv_ipv6 = yes; then | ||
| 420 | AC_DEFINE(INET6, 1, Define if you want IPv6 support.) | ||
| 421 | else | ||
| 422 | AC_MSG_WARN(*** IPv6 will not be supported ***) | ||
| 423 | ac_cv_enable_ipv6=no | ||
| 424 | fi | ||
| 425 | else | ||
| 426 | AC_MSG_RESULT(no) | ||
| 427 | fi | ||
| 428 | |||
| 429 | dnl for update check feature | ||
| 430 | AC_ARG_ENABLE(updatecheck, | ||
| 431 | [ --disable-updatecheck Disable update check feature], | ||
| 432 | [ac_cv_enable_updatecheck=$enableval], [ac_cv_enable_updatecheck=yes]) | ||
| 433 | if test x"$ac_cv_enable_updatecheck" = xyes ; then | ||
| 434 | AC_DEFINE(USE_UPDATE_CHECK, 1, Define if you want update check feature.) | ||
| 435 | |||
| 436 | dnl for update check feature (requires update check enabled) | ||
| 437 | AC_ARG_ENABLE(updatecheckplugin, | ||
| 438 | [ --disable-updatecheckplugin Disable update check plugin feature], | ||
| 439 | [ac_cv_enable_updatecheckplugin=$enableval], [ac_cv_enable_updatecheckplugin=yes]) | ||
| 440 | if test x"$ac_cv_enable_updatecheckplugin" = xyes ; then | ||
| 441 | AC_DEFINE(USE_UPDATE_CHECK_PLUGIN, 1, Define if you want update check plugin feature.) | ||
| 442 | fi | ||
| 443 | fi | ||
| 444 | |||
| 445 | dnl Check for d_type member in struct dirent | ||
| 446 | AC_MSG_CHECKING([whether struct dirent has d_type member]) | ||
| 447 | AC_CACHE_VAL(ac_cv_dirent_d_type,[ | ||
| 448 | AC_TRY_COMPILE([#include <dirent.h>], | ||
| 449 | [struct dirent d; d.d_type = DT_REG;], | ||
| 450 | ac_cv_dirent_d_type=yes, ac_cv_dirent_d_type=no) | ||
| 451 | ]) | ||
| 452 | AC_MSG_RESULT($ac_cv_dirent_d_type) | ||
| 453 | if test $ac_cv_dirent_d_type = yes; then | ||
| 454 | AC_DEFINE(HAVE_DIRENT_D_TYPE, 1, | ||
| 455 | Define if `struct dirent' has `d_type' member.) | ||
| 456 | fi | ||
| 457 | |||
| 458 | dnl Checks for liblockfile | ||
| 459 | AC_CHECK_HEADERS(lockfile.h) | ||
| 460 | AC_CHECK_LIB(lockfile, lockfile_create) | ||
| 461 | |||
| 462 | |||
| 463 | dnl Checks for header files. | ||
| 464 | AC_HEADER_DIRENT | ||
| 465 | AC_HEADER_STDC | ||
| 466 | AC_HEADER_SYS_WAIT | ||
| 467 | AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \ | ||
| 468 | sys/param.h sys/utsname.h sys/select.h \ | ||
| 469 | netdb.h regex.h sys/mman.h) | ||
| 470 | |||
| 471 | dnl Checks for typedefs, structures, and compiler characteristics. | ||
| 472 | AC_C_CONST | ||
| 473 | AC_TYPE_OFF_T | ||
| 474 | AC_TYPE_PID_T | ||
| 475 | AC_TYPE_SIZE_T | ||
| 476 | AC_STRUCT_TM | ||
| 477 | |||
| 478 | AC_SYS_LARGEFILE | ||
| 479 | AC_FUNC_FSEEKO | ||
| 480 | |||
| 481 | GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF, Used to test for a u32 typedef) | ||
| 482 | AC_CHECK_SIZEOF(unsigned short, 2) | ||
| 483 | AC_CHECK_SIZEOF(unsigned int, 4) | ||
| 484 | AC_CHECK_SIZEOF(unsigned long, 4) | ||
| 485 | AC_CHECK_SIZEOF(time_t) | ||
| 486 | AC_CHECK_SIZEOF(off_t) | ||
| 487 | |||
| 488 | if test "x$ac_cv_sizeof_time_t" = "x8"; then | ||
| 489 | AC_DEFINE(HAVE_64BIT_TIME_T, 1, Define if time_t is 64-bit) | ||
| 490 | fi | ||
| 491 | |||
| 492 | dnl Checks for library functions. | ||
| 493 | AC_FUNC_ALLOCA | ||
| 494 | AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr strchr \ | ||
| 495 | uname flock lockf inet_aton inet_addr \ | ||
| 496 | fchmod truncate getuid regcomp mlock fsync) | ||
| 497 | |||
| 498 | AC_OUTPUT([ | ||
| 499 | Makefile | ||
| 500 | sylpheed.spec | ||
| 501 | ac/Makefile | ||
| 502 | libsylph/Makefile | ||
| 503 | src/version.h | ||
| 504 | src/sylpheed.rc | ||
| 505 | src/Makefile | ||
| 506 | src/icons/Makefile | ||
| 507 | plugin/Makefile | ||
| 508 | plugin/attachment_tool/Makefile | ||
| 509 | plugin/test/Makefile | ||
| 510 | po/Makefile.in | ||
| 511 | faq/Makefile | ||
| 512 | faq/de/Makefile | ||
| 513 | faq/en/Makefile | ||
| 514 | faq/es/Makefile | ||
| 515 | faq/fr/Makefile | ||
| 516 | faq/it/Makefile | ||
| 517 | manual/Makefile | ||
| 518 | manual/en/Makefile | ||
| 519 | manual/ja/Makefile | ||
| 520 | nsis/Makefile | ||
| 521 | macosx/Makefile | ||
| 522 | macosx/bundle/Makefile | ||
| 523 | ]) | ||
| 524 | |||
| 525 | dnl Output the configuration summary | ||
| 526 | echo "" | ||
| 527 | echo "$PACKAGE $VERSION" | ||
| 528 | echo "" | ||
| 529 | echo "GnuPG : $ac_cv_enable_gpgme" | ||
| 530 | echo "JPilot : $ac_cv_enable_jpilot" | ||
| 531 | echo "LDAP : $ac_cv_enable_ldap" | ||
| 532 | echo "OpenSSL : $ac_cv_enable_ssl" | ||
| 533 | echo "iconv : $am_cv_func_iconv" | ||
| 534 | echo "compface : $ac_cv_enable_compface" | ||
| 535 | echo "IPv6 : $ac_cv_enable_ipv6" | ||
| 536 | echo "GtkSpell : $ac_cv_enable_gtkspell" | ||
| 537 | echo "Oniguruma : $ac_cv_enable_oniguruma" | ||
| 538 | echo "GThread : $use_threads" | ||
| 539 | echo "" | ||
| 540 | echo "The binary will be installed in $prefix/bin" | ||
| 541 | echo "" | ||
| 542 | echo "Configure finished, type 'make' to build." | ||
