removed two unnecessary autocrap-generated files
[k8lowj.git] / configure.in
blobf5e43663c1633d9f3e1782229039477525185aff
1 AC_PREREQ(2.52)
2 AC_INIT(logjam, 4.5.3.1, ketmar@ua.fm)
3 AC_CANONICAL_SYSTEM
4 AM_INIT_AUTOMAKE
5 AC_CONFIG_SRCDIR(src/jam.c)
6 AM_CONFIG_HEADER(config.h)
8 dnl Checks for programs.
9 AC_PROG_CC
10 AC_PROG_INSTALL
11 AC_PROG_LIBTOOL
12 AC_PROG_INTLTOOL
13 AC_CACHE_SAVE
15 AC_CHECK_HEADERS([regex.h])
17 dnl Check for gettext.
18 GETTEXT_PACKAGE=logjam
19 AC_SUBST(GETTEXT_PACKAGE)
20 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],"$GETTEXT_PACKAGE",[gettext package])
21 ALL_LINGUAS="es en_GB en_US.UTF-8 de he ja ru_RU uk_UA"
22 AM_GLIB_GNU_GETTEXT
24 dnl Even though the Unix versions don't use gthread, the soup
25 dnl library manages to tickle glib in a way that makes it unhappy
26 dnl unless we init threads.  So just bring it in always.
27 MODULES="glib-2.0 gobject-2.0 libxml-2.0 gthread-2.0"
29 AC_MSG_CHECKING([for mingw])
30 case "$host" in
31   *-*-mingw*)
32     CFLAGS="$CFLAGS -mms-bitfields"
33     with_dock="no (not supported on Windows)"
34     mingw=yes
35     ;;
36   *)
37     with_dock=yes
38     mingw=no
39     ;;
40 esac
41 AC_MSG_RESULT([$mingw])
43 dnl OSX doesn't have a socklen_t?
44 AC_C_SOCKLEN_T
46 AC_CACHE_SAVE
47 AC_ARG_ENABLE(pch,
48   AC_HELP_STRING([--enable-pch],
49                  [compile with GCC 3.4 precompiled headers]),
50   , [with_pch=no])
51 AM_CONDITIONAL(ENABLE_PCH, test "$enable_pch" = "yes")
53 AC_ARG_WITH(gtk,
54   AC_HELP_STRING([--without-gtk],
55                  [compile without GUI support]),
56   , [with_gtk=yes])
58 LJ_PKG_ARG_WITH(sqlite3, [SQLITE3],
59   AC_HELP_STRING([--with-sqlite3],
60                  [use sqlite backend (default autodetect)]),
61   sqlite3)
63 LJ_PKG_ARG_WITH(libsoup, [LIBSOUP],
64   AC_HELP_STRING([--with-libsoup],
65                  [use libsoup network backend]),
66   libsoup-2.2)
68 AC_MSG_CHECKING(whether to use gtk)
69 if test "$with_gtk" = "yes" ; then
70   AC_MSG_RESULT(yes)
71   MODULES="gtk+-2.0 >= 2.4 $MODULES"
72   LJ_PKG_ARG_WITH(gtkspell, GTKSPELL,
73     AC_HELP_STRING([--with-gtkspell],
74                    [compile with GtkSpell support (default autodetect)]),
75     gtkspell-2.0)
77    LJ_PKG_ARG_WITH(gtkhtml330, GTKHTML330,
78     AC_HELP_STRING([--with-gtkhtml],
79                    [compile with GtkHtml3.30 support (default autodetect)]),
80     libgtkhtml-3.30)
81   if test "$with_gtkhtml330" = "yes"; then
82     with_gtkhtml="3.30"
83   else
84     with_gtkhtml="no"
85   fi
86   if test "$with_gtkhtml" != "no"; then
87     AC_DEFINE(HAVE_GTKHTML,1,[do we have a gtkhtml?])
88   fi
90   LJ_PKG_ARG_WITH(librsvg, LIBRSVG,
91     AC_HELP_STRING([--with-librsvg],
92                    [compile with librsvg support (default autodetect)]),
93     librsvg-2.0 > 2.2.3)
95   AC_MSG_CHECKING(whether to use dock)
96   if test "$with_dock" = "yes" ; then
97     AC_DEFINE(USE_DOCK, 1, [should we use dock?])
98     AC_MSG_RESULT(yes)
99   else
100     AC_MSG_RESULT(no)
101   fi
103   PKG_CHECK_MODULES(LOGJAM, $MODULES)
104   AC_SUBST(LOGJAM_CFLAGS)
105   AC_SUBST(LOGJAM_LIBS)
106   AC_DEFINE(HAVE_GTK, 1, [do we have gtk?])
107 else
108   # no gtk
109   AC_MSG_RESULT(no)
110   PKG_CHECK_MODULES(LOGJAM, $MODULES)
111   AC_SUBST(LOGJAM_CFLAGS)
112   AC_SUBST(LOGJAM_LIBS)
113   with_gtkspell=no
114   with_gtkhtml=no
115   with_librsvg=no
116   with_dock=no
118 AM_CONDITIONAL(WITH_DOCK, test "$with_dock" = "yes")
119 AM_CONDITIONAL(WITH_GTK, test "$with_gtk" = "yes")
121 dnl We were gonna support dashboard, but it looked like development stalled.
122 dnl AC_ARG_WITH(dashboard,
123 dnl   AC_HELP_STRING([--with-dashboard],
124 dnl      [compile with dashboard (http://www.nat.org/dashboard) support]),
125 dnl   , [with_dashboard=no])
126 dnl 
127 dnl AC_MSG_CHECKING(whether to use dashboard)
128 dnl if test "$with_dashboard" = "yes" ; then
129 dnl   AC_DEFINE(USE_DASHBOARD, 1, [should we use dashboard?])
130 dnl   AC_MSG_RESULT(yes)
131 dnl else
132 dnl   AC_MSG_RESULT(no)
133 dnl fi
134 dnl AM_CONDITIONAL(USE_DASHBOARD, test "$with_dashboard" = "yes")
136 dnl Choose networking backend.
137 network_backend=
138 NETWORK_CFLAGS=
139 NETWORK_LIBS=
140 if test "$mingw" = "yes" ; then
141   network_backend=win32
142   NETWORK_CFLAGS=
143   NETWORK_LIBS=-lwininet
144 elif test "$with_libsoup" != "no" ; then
145   network_backend=libsoup
146 elif test "$with_curl" != "no" ; then
147   AC_PATH_PROG(CURL_CONFIG, curl-config, no)
148   if test "$CURL_CONFIG" = "no" ; then
149     dnl only bitch at them if they explicitly requested libcurl
150     if test "$with_curl" = "yes" ; then
151       AC_MSG_ERROR(The curl-config script installed by libcurl could not be found.)
152     fi
153   else
154     network_backend=curl
155     NETWORK_CFLAGS="`curl-config --cflags` -I`curl-config --prefix`/include"
156     NETWORK_LIBS="`curl-config --libs` -L`curl-config --prefix`/lib -lcurl"
157   fi
160 dnl if we didn't find one above, we use libxml's nanohttp.
161 if test -z "$network_backend" ; then 
162   network_backend=libxml
165 AM_CONDITIONAL(WITH_LIBSOUP, test "$network_backend" = "libsoup")
166 AM_CONDITIONAL(WITH_CURL, test "$network_backend" = "curl")
167 AC_SUBST(NETWORK_CFLAGS)
168 AC_SUBST(NETWORK_LIBS)
170 XMMS_LIBS=
171 XMMS_CFLAGS=
173 AC_ARG_WITH(xmms, 
174   AC_HELP_STRING([--with-xmms], [build xmms helper (default autodetect)]),
175   , [with_xmms=yes])
177 if test "$with_xmms" = "yes"; then
178   AC_CHECK_PROG(XMMS_CONFIG, xmms-config, xmms-config, no)
179   if test "$XMMS_CONFIG" = "no"; then
180     AC_MSG_WARN([cannot find xmms-config; XMMS support disabled.])
181     with_xmms=no
182     XMMS_TYPE=0
183   else
184     XMMS_LIBS=`$XMMS_CONFIG --libs`
185     XMMS_CFLAGS=`$XMMS_CONFIG --cflags`
186     XMMS_TYPE=1
187   fi
189 AC_SUBST(XMMS_LIBS)
190 AC_SUBST(XMMS_CFLAGS)
192 dnl liblivejournal dependencies.
193 MODULES="glib-2.0 gobject-2.0 libxml-2.0"
194 PKG_CHECK_MODULES(LIVEJOURNAL, $MODULES)
195 AC_SUBST(LIVEJOURNAL_CFLAGS)
196 AC_SUBST(LIVEJOURNAL_LIBS)
197 dnl end liblivejournal dependencies.
199 AM_CONDITIONAL(WITH_XMMS, test "$with_xmms" = "yes")
200 AM_CONDITIONAL(WITH_HTML, test "$with_gtkhtml" != "no")
201 AM_CONDITIONAL(WITH_RSVG, test "$with_librsvg" = "yes")
202 AM_CONDITIONAL(WITH_SQLITE3, test "$with_sqlite3" = "yes")
203 AM_CONDITIONAL(WIN32, test "$mingw" = "yes")
205 dnl pull in liblivejournal.
206 AC_CONFIG_SUBDIRS(protocol/liblivejournal)
208 AC_CONFIG_FILES([Makefile po/Makefile.in
209 doc/Makefile data/Makefile images/Makefile
210 util/Makefile util/xmmsclient/Makefile
211 protocol/Makefile
212 src/Makefile])
213 AC_OUTPUT
214 dnl punted for this release:
215 dnl  - protocol/blogger/Makefile
216 dnl  - util/gxr/Makefile 
218 echo ""
219 echo " logjam ${VERSION} build configuration:"
220 echo ""
221 echo "    - GTK: ${with_gtk}"
222 echo "      - GtkSpell: ${with_gtkspell}"
223 echo "      - GtkHTML: ${with_gtkhtml}"
224 echo "      - librsvg: ${with_librsvg}"
225 echo "      - Docklet (\"tray icon\"): ${with_dock}"
226 dnl echo "    - Use dashboard: ${with_dashboard}"
227 echo "    - Networking: ${network_backend}"
228 if test "$network_backend" = "libxml"; then
229   echo "        WARNING: libxml network backend does not support proxy auth."
230   echo "        Additionally, it provides less feedback while processing,"
231   echo "        and it fails less gracefully than Curl."
232   echo "        If you need these features, you must build with Curl."
234 echo "    - XMMS helper: ${with_xmms}"
235 echo "    - SQLite3: ${with_sqlite3}"
236 echo ""
238 dnl vim: set ts=2 sw=2 et :