Statistics
| Branch: | Tag: | Revision:

root / configure.ac @ master

History | View | Annotate | Download (4.09 KB)

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