root / configure.in @ 56
History | View | Annotate | Download (10.2 kB)
| 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=1 |
| 8 | MINOR_VERSION=9 |
| 9 | MICRO_VERSION=0 |
| 10 | INTERFACE_AGE=0 |
| 11 | BINARY_AGE=0 |
| 12 | EXTRA_VERSION=pre |
| 13 | VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION |
| 14 | |
| 15 | dnl set $target |
| 16 | AC_CANONICAL_SYSTEM |
| 17 | |
| 18 | dnl |
| 19 | AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define) |
| 20 | dnl AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") |
| 21 | dnl AC_DEFINE_UNQUOTED(VERSION, "$VERSION") |
| 22 | AC_SUBST(PACKAGE) |
| 23 | AC_SUBST(VERSION) |
| 24 | |
| 25 | dnl libtool versioning |
| 26 | LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION |
| 27 | LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE` |
| 28 | LT_REVISION=$INTERFACE_AGE |
| 29 | LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE` |
| 30 | AC_SUBST(LT_RELEASE) |
| 31 | AC_SUBST(LT_CURRENT) |
| 32 | AC_SUBST(LT_REVISION) |
| 33 | AC_SUBST(LT_AGE) |
| 34 | |
| 35 | dnl Specify a header configuration file |
| 36 | AM_CONFIG_HEADER(config.h) |
| 37 | |
| 38 | AM_MAINTAINER_MODE |
| 39 | |
| 40 | dnl Checks for programs. |
| 41 | dnl AC_ARG_PROGRAM |
| 42 | AC_PROG_CC |
| 43 | AC_ISC_POSIX |
| 44 | AM_PROG_CC_STDC |
| 45 | AC_PROG_INSTALL |
| 46 | AC_PROG_LN_S |
| 47 | AC_PROG_MAKE_SET |
| 48 | AC_PROG_CPP |
| 49 | dnl AC_PROG_RANLIB |
| 50 | AM_PROG_LEX |
| 51 | AC_PROG_YACC |
| 52 | AM_PROG_LIBTOOL |
| 53 | |
| 54 | SYLPHEED_ACLOCAL_INCLUDE(ac) |
| 55 | |
| 56 | case "$target" in |
| 57 | *-darwin*) |
| 58 | CFLAGS="$CFLAGS -traditional-cpp -fno-common" |
| 59 | ;; |
| 60 | esac |
| 61 | |
| 62 | dnl checks for iconv |
| 63 | AM_ICONV |
| 64 | |
| 65 | dnl |
| 66 | dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in. |
| 67 | dnl |
| 68 | syl_save_LIBS=$LIBS |
| 69 | LIBS="$LIBS $GTK_LIBS" |
| 70 | AC_CHECK_FUNCS(bind_textdomain_codeset) |
| 71 | LIBS=$syl_save_LIBS |
| 72 | |
| 73 | dnl for gettext |
| 74 | ALL_LINGUAS="bg cs da de el es et fr gl hr hu it ja ko nl pl pt_BR ro ru sk sl sr sv tr uk zh_CN zh_TW.Big5" |
| 75 | GETTEXT_PACKAGE=sylpheed |
| 76 | AC_SUBST(GETTEXT_PACKAGE) |
| 77 | AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define text domain.]) |
| 78 | dnl AM_GLIB_GNU_GETTEXT |
| 79 | AM_GNU_GETTEXT |
| 80 | dnl AC_CHECK_FUNC(gettext, AC_CHECK_LIB(intl, gettext)) |
| 81 | localedir='${prefix}/${DATADIRNAME}/locale'
|
| 82 | AC_SUBST(localedir) |
| 83 | |
| 84 | manualdir='${prefix}/${DATADIRNAME}/${PACKAGE}/manual'
|
| 85 | AC_SUBST(manualdir) |
| 86 | faqdir='${prefix}/${DATADIRNAME}/${PACKAGE}/faq'
|
| 87 | AC_SUBST(faqdir) |
| 88 | |
| 89 | dnl Checks for libraries. |
| 90 | PKG_CHECK_MODULES(GTK, \ |
| 91 | [ glib-2.0 gthread-2.0 gdk-pixbuf-2.0 gtk+-2.0 ], , |
| 92 | [ AC_MSG_ERROR(Test for GTK+-2.0 failed. See the file 'INSTALL' for help.) ]) |
| 93 | AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal) |
| 94 | |
| 95 | dnl --disable-deprecated switch for GTK2 purification |
| 96 | AC_ARG_ENABLE(deprecated, [ --disable-deprecated Disable deprecated GTK functions. ], |
| 97 | [GTK_CFLAGS="$GTK_CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"], []) |
| 98 | |
| 99 | AC_SUBST(GTK_CFLAGS) |
| 100 | AC_SUBST(GTK_LIBS) |
| 101 | |
| 102 | dnl Check for built-in image view support |
| 103 | AC_ARG_ENABLE(gdk-pixbuf, |
| 104 | [ --disable-gdk-pixbuf Do not use gdk-pixbuf], |
| 105 | [ac_cv_enable_gdk_pixbuf=$enableval], [ac_cv_enable_gdk_pixbuf=yes]) |
| 106 | |
| 107 | if test "$ac_cv_enable_gdk_pixbuf" = yes; then |
| 108 | AC_DEFINE(HAVE_GDK_PIXBUF, 1, Define if you use gdk-pixbuf to support image view) |
| 109 | fi |
| 110 | |
| 111 | dnl GPGME is used to support OpenPGP |
| 112 | AC_ARG_ENABLE(gpgme, |
| 113 | [ --enable-gpgme Enable GnuPG support using GPGME [default=no]], |
| 114 | [ac_cv_enable_gpgme=$enableval], [ac_cv_enable_gpgme=no]) |
| 115 | AC_MSG_CHECKING([whether to use GPGME]) |
| 116 | if test $ac_cv_enable_gpgme = yes; then |
| 117 | AC_MSG_RESULT(yes) |
| 118 | AM_PATH_GPGME(0.4.5, AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.), |
| 119 | [use_gpgme=no |
| 120 | ac_cv_enable_gpgme=no]) |
| 121 | else |
| 122 | AC_MSG_RESULT(no) |
| 123 | fi |
| 124 | |
| 125 | dnl for JPilot support in addressbook |
| 126 | dnl no check for libraries; these are dynamically loaded |
| 127 | AC_ARG_ENABLE(jpilot, |
| 128 | [ --enable-jpilot Enable JPilot support [default=no]], |
| 129 | [ac_cv_enable_jpilot=$enableval], [ac_cv_enable_jpilot=no]) |
| 130 | AC_MSG_CHECKING([whether to use JPilot]) |
| 131 | if test "$ac_cv_enable_jpilot" = yes; then |
| 132 | AC_MSG_RESULT(yes) |
| 133 | AC_CHECK_HEADERS(pi-args.h pi-appinfo.h pi-address.h, |
| 134 | [ AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ], |
| 135 | [ ac_cv_enable_jpilot=no ]) |
| 136 | if test "$ac_cv_enable_jpilot" = no; then |
| 137 | AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h, |
| 138 | [ ac_cv_enable_jpilot=yes |
| 139 | AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ]) |
| 140 | fi |
| 141 | AC_MSG_CHECKING([whether jpilot is available]) |
| 142 | AC_MSG_RESULT($ac_cv_enable_jpilot) |
| 143 | |
| 144 | if test "$ac_cv_enable_jpilot" = yes; then |
| 145 | LIBS="$LIBS -lpisock" |
| 146 | fi |
| 147 | else |
| 148 | AC_MSG_RESULT(no) |
| 149 | fi |
| 150 | |
| 151 | dnl for LDAP support in addressbook |
| 152 | dnl no check for libraries; dynamically loaded |
| 153 | AC_ARG_ENABLE(ldap, |
| 154 | [ --enable-ldap Enable LDAP support [default=no]], |
| 155 | [ac_cv_enable_ldap=$enableval], [ac_cv_enable_ldap=no]) |
| 156 | AC_MSG_CHECKING([whether to use LDAP]) |
| 157 | if test "$ac_cv_enable_ldap" = yes; then |
| 158 | AC_MSG_RESULT(yes) |
| 159 | |
| 160 | dnl check for available libraries, and pull them in |
| 161 | AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="$LDAP_LIBS -lresolv") |
| 162 | AC_CHECK_LIB(socket, bind, LDAP_LIBS="$LDAP_LIBS -lsocket") |
| 163 | AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl") |
| 164 | AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS="$LDAP_LIBS -llber",, |
| 165 | $LDAP_LIBS) |
| 166 | |
| 167 | dnl we need libpthread for sylpheed ldap, until we find |
| 168 | dnl a better way to handle ldap requests asynchronously... |
| 169 | AC_CHECK_LIB(pthread, pthread_create, LDAP_LIBS="$LDAP_LIBS -lpthread") |
| 170 | |
| 171 | AC_CHECK_HEADERS(ldap.h lber.h pthread.h, |
| 172 | [ ac_cv_enable_ldap=yes ], |
| 173 | [ ac_cv_enable_ldap=no ]) |
| 174 | |
| 175 | if test "$ac_cv_enable_ldap" = yes; then |
| 176 | AC_CHECK_LIB(ldap, ldap_open, |
| 177 | [ ac_cv_enable_ldap=yes ], |
| 178 | [ ac_cv_enable_ldap=no ], |
| 179 | $LDAP_LIBS) |
| 180 | fi |
| 181 | |
| 182 | AC_MSG_CHECKING([whether ldap library is available]) |
| 183 | AC_MSG_RESULT($ac_cv_enable_ldap) |
| 184 | |
| 185 | if test "$ac_cv_enable_ldap" = yes; then |
| 186 | CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`" |
| 187 | LDAP_LIBS="$LDAP_LIBS -lldap `$GLIB_CONFIG --libs gthread`" |
| 188 | AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.) |
| 189 | AC_SUBST(LDAP_LIBS) |
| 190 | fi |
| 191 | else |
| 192 | AC_MSG_RESULT(no) |
| 193 | fi |
| 194 | |
| 195 | dnl Check for OpenSSL |
| 196 | AC_ARG_ENABLE(ssl, |
| 197 | [ --enable-ssl Enable SSL support using OpenSSL [default=no]], |
| 198 | [ac_cv_enable_ssl=$enableval], [ac_cv_enable_ssl=no]) |
| 199 | AC_MSG_CHECKING([whether to use OpenSSL]) |
| 200 | if test $ac_cv_enable_ssl = yes; then |
| 201 | AC_MSG_RESULT(yes) |
| 202 | AC_MSG_CHECKING([if openssl is available]) |
| 203 | LIBS="$LIBS -lssl -lcrypto" |
| 204 | AC_TRY_LINK([ |
| 205 | #include <openssl/opensslv.h> |
| 206 | ], [ return OPENSSL_VERSION_NUMBER; ], |
| 207 | [ AC_MSG_RESULT(yes) |
| 208 | AC_DEFINE(USE_SSL, 1, Define if you use OpenSSL to support SSL.) ], |
| 209 | [ AC_MSG_RESULT(no) |
| 210 | LIBS="$ac_save_LIBS" |
| 211 | ac_cv_enable_ssl=no ]) |
| 212 | else |
| 213 | AC_MSG_RESULT(no) |
| 214 | fi |
| 215 | |
| 216 | dnl Check for X-Face support |
| 217 | AC_ARG_ENABLE(compface, |
| 218 | [ --disable-compface Do not use compface (X-Face)], |
| 219 | [ac_cv_enable_compface=$enableval], [ac_cv_enable_compface=yes]) |
| 220 | if test "$ac_cv_enable_compface" = yes; then |
| 221 | AC_CHECK_LIB(compface, uncompface,,[ac_cv_enable_compface=no]) |
| 222 | fi |
| 223 | |
| 224 | AC_CHECK_LIB(xpg4, setlocale) |
| 225 | |
| 226 | dnl for GThread support (currently disabled) |
| 227 | dnl AC_ARG_ENABLE(threads, |
| 228 | dnl [ --enable-threads Enable multithread support [default=no]], |
| 229 | dnl [use_threads=$enableval], [use_threads=no]) |
| 230 | |
| 231 | AC_MSG_CHECKING([whether to use threads]) |
| 232 | if test x"$use_threads" = xyes ; then |
| 233 | AC_MSG_RESULT(yes) |
| 234 | if test ! -z `$GLIB_CONFIG --help 2>&1 |grep 'gthread'` ; then |
| 235 | CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`" |
| 236 | LIBS="$LIBS `$GLIB_CONFIG --libs gthread`" |
| 237 | AC_DEFINE(USE_THREADS, 1, Whether to use multithread or not) |
| 238 | else |
| 239 | AC_MSG_ERROR([Sylpheed requires GThread from GLib to use threading.]) |
| 240 | fi |
| 241 | else |
| 242 | AC_MSG_RESULT(no) |
| 243 | fi |
| 244 | |
| 245 | dnl check for IPv6 option |
| 246 | AC_ARG_ENABLE(ipv6, |
| 247 | [ --disable-ipv6 Disable IPv6 support], |
| 248 | [ac_cv_enable_ipv6=$enableval], [ac_cv_enable_ipv6=yes]) |
| 249 | |
| 250 | dnl automated checks for IPv6 support. |
| 251 | AC_MSG_CHECKING([whether to use IPv6]) |
| 252 | if test x"$ac_cv_enable_ipv6" = xyes; then |
| 253 | AC_MSG_RESULT(yes) |
| 254 | AC_MSG_CHECKING([for IPv6 support]) |
| 255 | AC_CACHE_VAL(ac_cv_ipv6,[ |
| 256 | AC_TRY_COMPILE([#define INET6 |
| 257 | #include <sys/types.h> |
| 258 | #include <netinet/in.h>], |
| 259 | [int x = IPPROTO_IPV6; struct in6_addr a;], |
| 260 | ac_cv_ipv6=yes, ac_cv_ipv6=no) |
| 261 | ]) |
| 262 | AC_MSG_RESULT($ac_cv_ipv6) |
| 263 | if test $ac_cv_ipv6 = yes; then |
| 264 | AC_DEFINE(INET6, 1, Define if you want IPv6 support.) |
| 265 | else |
| 266 | AC_MSG_WARN(*** IPv6 will not be supported ***) |
| 267 | ac_cv_enable_ipv6=no |
| 268 | fi |
| 269 | else |
| 270 | AC_MSG_RESULT(no) |
| 271 | fi |
| 272 | |
| 273 | dnl Check for d_type member in struct dirent |
| 274 | AC_MSG_CHECKING([whether struct dirent has d_type member]) |
| 275 | AC_CACHE_VAL(ac_cv_dirent_d_type,[ |
| 276 | AC_TRY_COMPILE([#include <dirent.h>], |
| 277 | [struct dirent d; d.d_type = DT_REG;], |
| 278 | ac_cv_dirent_d_type=yes, ac_cv_dirent_d_type=no) |
| 279 | ]) |
| 280 | AC_MSG_RESULT($ac_cv_dirent_d_type) |
| 281 | if test $ac_cv_dirent_d_type = yes; then |
| 282 | AC_DEFINE(HAVE_DIRENT_D_TYPE, 1, |
| 283 | Define if `struct dirent' has `d_type' member.) |
| 284 | fi |
| 285 | |
| 286 | |
| 287 | dnl Checks for header files. |
| 288 | AC_HEADER_DIRENT |
| 289 | AC_HEADER_STDC |
| 290 | AC_HEADER_SYS_WAIT |
| 291 | AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \ |
| 292 | sys/param.h sys/utsname.h sys/select.h \ |
| 293 | wchar.h wctype.h) |
| 294 | |
| 295 | dnl Checks for typedefs, structures, and compiler characteristics. |
| 296 | AC_C_CONST |
| 297 | AC_TYPE_OFF_T |
| 298 | AC_TYPE_PID_T |
| 299 | AC_TYPE_SIZE_T |
| 300 | AC_STRUCT_TM |
| 301 | |
| 302 | AC_SYS_LARGEFILE |
| 303 | AC_FUNC_FSEEKO |
| 304 | |
| 305 | dnl AC_CHECK_TYPE(wint_t, unsigned int) does not work because wint_t |
| 306 | dnl may be defined only in wchar.h (this happens with gcc-2.96). |
| 307 | dnl So we need to use this extended macro. |
| 308 | SYLPHEED_CHECK_TYPE(wint_t, unsigned int, |
| 309 | [ |
| 310 | #if HAVE_WCHAR_H |
| 311 | #include <wchar.h> |
| 312 | #endif |
| 313 | ], Define to `unsigned int' if <stddef.h> or <wchar.h> doesn't define.) |
| 314 | |
| 315 | GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF, Used to test for a u32 typedef) |
| 316 | AC_CHECK_SIZEOF(unsigned short, 2) |
| 317 | AC_CHECK_SIZEOF(unsigned int, 4) |
| 318 | AC_CHECK_SIZEOF(unsigned long, 4) |
| 319 | |
| 320 | dnl Checks for library functions. |
| 321 | AC_FUNC_ALLOCA |
| 322 | AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr strchr \ |
| 323 | wcsstr wcswcs iswalnum iswspace towlower \ |
| 324 | wcslen wcscpy wcsncpy \ |
| 325 | uname flock lockf inet_aton inet_addr \ |
| 326 | fchmod mkstemp) |
| 327 | |
| 328 | AC_OUTPUT([ |
| 329 | Makefile |
| 330 | sylpheed.spec |
| 331 | intl/Makefile |
| 332 | ac/Makefile |
| 333 | po/Makefile.in |
| 334 | src/version.h |
| 335 | src/Makefile |
| 336 | faq/Makefile |
| 337 | faq/de/Makefile |
| 338 | faq/en/Makefile |
| 339 | faq/es/Makefile |
| 340 | faq/fr/Makefile |
| 341 | faq/it/Makefile |
| 342 | manual/Makefile |
| 343 | manual/en/Makefile |
| 344 | manual/ja/Makefile |
| 345 | ]) |
| 346 | |
| 347 | dnl Output the configuration summary |
| 348 | echo "" |
| 349 | echo "$PACKAGE $VERSION" |
| 350 | echo "" |
| 351 | echo "image support : $ac_cv_enable_gdk_pixbuf" |
| 352 | echo "GnuPG : $ac_cv_enable_gpgme" |
| 353 | echo "JPilot : $ac_cv_enable_jpilot" |
| 354 | echo "LDAP : $ac_cv_enable_ldap" |
| 355 | echo "OpenSSL : $ac_cv_enable_ssl" |
| 356 | echo "iconv : $am_cv_func_iconv" |
| 357 | echo "compface : $ac_cv_enable_compface" |
| 358 | echo "IPv6 : $ac_cv_enable_ipv6" |
| 359 | echo "" |
| 360 | echo "The binary will be installed in $prefix/bin" |
| 361 | echo "" |
| 362 | echo "Configure finished, type 'make' to build." |