1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
|
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
AC_INIT(src/sylfilter.c)
dnl set $target
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE(sylfilter, 0.8)
AC_CONFIG_SRCDIR([src/sylfilter.c])
AC_CONFIG_HEADER([config.h])
# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AM_PROG_LIBTOOL
MATH_LIB=-lm
native_win32=no
case "$target" in
*-*-mingw*)
native_win32=yes
MATH_LIB=
CFLAGS="$CFLAGS -mms-bitfields"
AC_DEFINE(HAVE_WIN32, 1, Define if you have native Win32 environment.)
;;
esac
AM_CONDITIONAL(NATIVE_WIN32, test "$native_win32" = "yes")
AC_SUBST(MATH_LIB)
# Checks for libraries.
AM_PATH_GLIB_2_0(2.0.0,, AC_MSG_ERROR(Test for GLib failed. See the 'INSTALL' for help.))
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
have_kvs=no
AC_ARG_ENABLE(sqlite,
[ --enable-sqlite Enable SQLite3 support [[default=yes]]],
[ac_cv_enable_sqlite=$enableval], [ac_cv_enable_sqlite=yes])
AC_ARG_ENABLE(qdbm,
[ --enable-qdbm Enable QDBM support [[default=no]]],
[ac_cv_enable_qdbm=$enableval], [ac_cv_enable_qdbm=no])
AC_ARG_ENABLE(gdbm,
[ --enable-gdbm Enable GDBM support [[default=no]]],
[ac_cv_enable_gdbm=$enableval], [ac_cv_enable_gdbm=no])
AC_MSG_CHECKING([whether to enable SQLite3])
AC_MSG_RESULT($ac_cv_enable_sqlite)
if test $ac_cv_enable_sqlite = yes; then
PKG_CHECK_MODULES(SQLITE, sqlite3,
[ AC_DEFINE(USE_SQLITE, 1, Define if you have SQLite3.)
have_kvs=yes ], ac_cv_enable_sqlite=no )
fi
AC_MSG_CHECKING([whether to enable QDBM])
AC_MSG_RESULT($ac_cv_enable_qdbm)
if test $ac_cv_enable_qdbm = yes; then
PKG_CHECK_MODULES(QDBM, qdbm,
[ AC_DEFINE(USE_QDBM, 1, Define if you have QDBM.)
have_kvs=yes ], ac_cv_enable_qdbm=no )
fi
AC_MSG_CHECKING([whether to enable GDBM])
AC_MSG_RESULT($ac_cv_enable_gdbm)
if test $ac_cv_enable_gdbm = yes; then
AC_CHECK_LIB(gdbm, gdbm_open,
[ AC_DEFINE(USE_GDBM, 1, Define if you have GDBM.)
GDBM_LIBS="-lgdbm"
AC_SUBST(GDBM_LIBS)
have_kvs=yes ], ac_cv_enable_gdbm=no )
fi
if test $have_kvs != yes; then
AC_MSG_ERROR(Key-value store not found.)
fi
if test $ac_cv_enable_qdbm = yes -a $ac_cv_enable_gdbm = yes; then
AC_MSG_ERROR(QDBM and GDBM cannot be specified at the same time.)
fi
# Toggle Win32 Console/GUI app
AC_ARG_ENABLE(windows,
[ --enable-windows Enable Windows GUI executable ],
[enable_windows=$enableval], [enable_windows=no])
if test "$native_win32" = yes; then
if test "$enable_windows" = yes; then
CFLAGS="$CFLAGS -mwindows"
fi
fi
# LibSylph type
libsylph_type=builtin
AC_ARG_WITH(libsylph,
[ --with-libsylph=[[builtin/standalone/sylpheed]] select LibSylph to use],
libsylph_type=$with_libsylph)
AC_ARG_WITH(libsylph-dir,
[AC_HELP_STRING([--with-libsylph-dir=DIR], [search for LibSylph in DIR/include and DIR/lib])],
[if test "x$with_libsylph_dir" != x; then
LDFLAGS="$LDFLAGS -L$with_libsylph_dir/lib"
fi])
AC_SUBST(libsylph_type)
case $libsylph_type in
builtin)
AC_DEFINE(BUILTIN_LIBSYLPH, 1, Define if you use built-in LibSylph.)
;;
standalone)
AC_CHECK_LIB(sylph, syl_init, LIBSYLPH_LIBS="-lsylph", AC_MSG_ERROR(Test for LibSylph (standalone) failed.))
if test "x$with_libsylph_dir" != x; then
CPPFLAGS="$CPPFLAGS -I$with_libsylph_dir/include"
fi
;;
sylpheed)
AC_CHECK_LIB(sylph-0, syl_init, LIBSYLPH_LIBS="-lsylph-0", AC_MSG_ERROR(Test for LibSylph (Sylpheed-included) failed.))
if test "x$with_libsylph_dir" != x; then
CPPFLAGS="$CPPFLAGS -I$with_libsylph_dir/include/sylpheed"
fi
;;
*) AC_MSG_ERROR([Invalid type for LibSylph: use builtin, standalone, or sylpheed.]) ;;
esac
AC_SUBST(LIBSYLPH_LIBS)
AM_CONDITIONAL(BUILTIN_LIBSYLPH, test "$libsylph_type" = "builtin")
# Checks for iconv
AM_ICONV
# Checks for header files.
AC_HEADER_STDC
AC_HEADER_DIRENT
AC_HEADER_SYS_WAIT
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_CHECK_FUNCS(ftruncate fsync)
AC_CONFIG_FILES([Makefile
libsylph/Makefile
lib/Makefile
lib/filters/Makefile
src/Makefile
test/Makefile])
AC_OUTPUT
|