More output.
[doldaconnect.git] / configure.in
CommitLineData
d3372da9 1AC_INIT(daemon/main.c)
932e94ad 2AM_INIT_AUTOMAKE([doldaconnect], [0.4])
d3372da9 3AM_CONFIG_HEADER(config.h)
4
5AC_PROG_CC
6AC_PROG_INSTALL
7
8AM_GNU_GETTEXT_VERSION(0.12.1)
9AM_GNU_GETTEXT([external])
5d0dcf5c 10
11# Temporary hack to make libtool not check for g++ or g77
12m4_defun([_LT_AC_LANG_CXX_CONFIG], true)
13m4_defun([_LT_AC_LANG_F77_CONFIG], true)
d3372da9 14AM_PROG_LIBTOOL
15
16AC_CHECK_LIB(pam, pam_start, , AC_MSG_ERROR([*** must have PAM]))
d3372da9 17AC_CHECK_LIB(z, deflate, , AC_MSG_ERROR([*** must have zlib]))
18AC_CHECK_LIB(bz2, BZ2_bzWriteOpen, , AC_MSG_ERROR([*** must have bzlib]))
05fe12f8 19AC_CHECK_LIB(gdbm, gdbm_open, , AC_MSG_ERROR([*** must have gdbm]))
d3372da9 20
21clients=
22extlibs=
23experimental=no
24
25AC_CHECK_PROG([PKG_CONFIG], pkg-config, yes, no)
26
0c1a8103 27# Gtk 2.0 check
d3372da9 28AC_ARG_WITH(gtk2, [ --with-gtk2 Enable GTK2 support])
29if test "$with_gtk2" = no; then
30 HAS_GTK2=no
31fi
32if test "$HAS_GTK2" != no; then
33 if test "$PKG_CONFIG" = yes; then
34 AC_MSG_CHECKING([for GTK2 package information])
35 if pkg-config --modversion gtk+-2.0 >/dev/null 2>&1; then
36 AC_MSG_RESULT(yes)
37 else
38 AC_MSG_RESULT(no)
39 HAS_GTK2=no
40 fi
41 if test "$HAS_GTK2" != no; then
42 AC_CHECK_LIB(gtk-x11-2.0, gtk_init, [HAS_GTK2=yes], [HAS_GTK2=no], `pkg-config --libs gtk+-2.0`)
43 fi
44 if test "$HAS_GTK2" = yes; then
45 cpp_bak="$CPPFLAGS"
46 CPPFLAGS="$CPPFLAGS `pkg-config --cflags gtk+-2.0`"
47 AC_CHECK_HEADER(gtk/gtk.h, [], [HAS_GTK2=no])
48 CPPFLAGS="$cpp_bak"
49 fi
50 else
51 HAS_GTK2=no
52 fi
53fi
54if test "$with_gtk2" = yes -a "$HAS_GTK2" = no; then
55 AC_MSG_ERROR([*** cannot find GTK2 on this system])
56fi
57
0c1a8103 58# libxml2 check
59AC_MSG_CHECKING([for libxml2 package information])
60if test "$PKG_CONFIG" = yes; then
61 if pkg-config --modversion libxml-2.0 >/dev/null 2>&1; then
62 AC_MSG_RESULT(yes)
63 else
64 AC_MSG_RESULT(no)
65 HAS_LIBXML=no
66 fi
67 if test "$HAS_LIBXML" != no; then
68 AC_CHECK_LIB(xml2, xmlReadFile, [HAS_LIBXML=yes], [HAS_LIBXML=no], `pkg-config --libs libxml-2.0`)
69 fi
70else
71 AC_MSG_RESULT(no)
72 HAS_LIBXML=no
73fi
74
bbc9d874 75# libnotify check
76AC_MSG_CHECKING([for libnotify package information])
77if test "$PKG_CONFIG" = yes; then
78 if pkg-config --modversion libnotify >/dev/null 2>&1; then
79 AC_MSG_RESULT(yes)
80 else
81 AC_MSG_RESULT(no)
82 HAS_LIBNOTIFY=no
83 fi
84else
85 AC_MSG_RESULT(no)
86 HAS_LIBNOTIFY=no
87fi
88if test "$HAS_LIBNOTIFY" != no; then
89 AC_CHECK_LIB(notify, notify_init, [HAS_LIBNOTIFY=yes], [HAS_LIBNOTIFY=no], `pkg-config --libs libnotify`)
90fi
91
0c1a8103 92# Gtk GUI check
d3372da9 93gtk2ui_msg=No
94AC_ARG_ENABLE(gtk2ui, [ --enable-gtk2ui Enable the GTK2 user interface])
0c1a8103 95if test "$enable_gtk2ui" = yes; then
f4e3c478 96 if test "$HAS_GTK2" = no; then
0c1a8103 97 AC_MSG_ERROR([*** cannot build the GTK2 UI without a GTK2 library])
98 fi
f4e3c478 99 if test "$HAS_LIBXML" = no; then
0c1a8103 100 AC_MSG_ERROR([*** the GTK2 UI needs libxml2])
101 fi
d3372da9 102fi
103if test "$enable_gtk2ui" != no -a "$HAS_GTK2" = yes; then
104 clients="$clients gtk2"
105 gtk2ui_msg=Yes
106fi
107
3589c61e 108# Dolconf check
109dolconf_msg=No
110AC_ARG_ENABLE(dolconf, [ --enable-dolconf Build the configuration helper])
111if test "$enable_dolconf" = yes -a "$HAS_GTK2" = no; then
112 AC_MSG_ERROR([*** cannot build dolconf without GTK2])
113fi
114if test "$enable_dolconf" != no -a "$HAS_GTK2" = yes; then
115 AM_CONDITIONAL(DOLCONF, true)
116 dolconf_msg=Yes
117else
118 AM_CONDITIONAL(DOLCONF, false)
119fi
120
0c1a8103 121# Gtk progress bar check
d3372da9 122gtk2pbar_msg=No
123AH_TEMPLATE(ENABLE_GTK2PBAR, [define to compile GTK2 progress bars (experimental)])
124AC_ARG_ENABLE(gtk2pbar, [ --enable-gtk2pbar Enable GTK2 progress bars (experimental)])
125if test "$enable_gtk2pbar" = yes; then
126 if test "$HAS_GTK2" = no; then
127 AC_MSG_ERROR([*** cannot build GTK2 progress bars without GTK2])
128 fi
129 experimental=yes
130 gtk2pbar_msg=Yes
131 AC_DEFINE(ENABLE_GTK2PBAR)
132fi
133
0c1a8103 134# Gnome applet check
d3372da9 135gnometrapplet_msg=No
136AC_ARG_ENABLE(gnomeapplet, [ --enable-gnomeapplet Enable GNOME transfer applet (experimental)])
137if test "$enable_gnomeapplet" = yes; then
138 experimental=yes
139 gnometrapplet_msg=Yes
140 clients="$clients gnome-trans-applet"
141fi
142
0c1a8103 143# Gaim plugin check
9db6483b 144gaimplugin_msg=No
145AC_ARG_ENABLE(gaimplugin, [ --enable-gaimplugin Enable GNOME transfer applet (experimental)])
146if test "$enable_gaimplugin" = yes; then
147 experimental=yes
148 gaimplugin_msg=Yes
149 clients="$clients gaim"
150fi
151
0c1a8103 152# Guile check (XXX: Shouldn't have to be enabled manually)
d3372da9 153guile_msg=No
154if test "$with_guile" = yes; then
155 GUILE_FLAGS
156 extlibs="$extlibs guile"
157 guile_msg=Yes
158fi
159
72e3daf5 160# Check whether to install baseconv
161AC_ARG_ENABLE(baseconv, [ --enable-baseconv Install the baseconv utility])
a1b1a665 162AM_CONDITIONAL(BASECONV, test "$enable_baseconv" = yes)
72e3daf5 163
0c1a8103 164# Kerberos check
d3372da9 165krb_msg=No
166AH_TEMPLATE(HAVE_KRB5, [define to compile support for Kerberos 5 (not GSS-API) authentication])
167AC_ARG_WITH(krb5, [ --with-krb5[=PATH] Enable Kerberos 5 (not GSSAPI) authentication])
168if test "$with_krb5" != no; then
169 cpp_bak="$CPPFLAGS"
170 ld_bak="$LDFLAGS"
171 if test "$with_krb5" != yes; then
172 CPPFLAGS="$CPPFLAGS -I${with_krb5}/include"
173 LDFLAGS="$LDFLAGS -L${with_krb5}/lib"
174 fi
175 AC_CHECK_LIB(krb5, krb5_init_context, [HAS_KRB5=yes], [HAS_KRB5=no])
176 if test "$HAS_KRB5" = yes; then
177 AC_CHECK_HEADER(com_err.h, [HAS_COMERR=yes], [HAS_COMERR=no])
178 if test "$HAS_COMERR" = no; then
179 AC_CHECK_HEADER(et/com_err.h, [HAS_COMERR=yes; CPPFLAGS="$CPPFLAGS -I/usr/include/et"], [])
180 fi
181 fi
182 if test "$HAS_COMERR" = no; then
183 HAS_KRB5=no
184 fi
185 if test "$HAS_KRB5" = no; then
186 CPPFLAGS="$cpp_bak"
187 LDFLAGS="$ld_bak"
188 fi
189fi
190KRB5_LDADD=
191if test -n "$with_krb5" -a "$with_krb5" != no -a "$HAS_KRB5" != yes; then
192 AC_MSG_ERROR([*** cannot find Kerberos 5 on this system - try passing --with-krb5=/path/to/kerberos])
193fi
194if test "$with_krb5" != no -a "$HAS_KRB5" = yes; then
195 AC_DEFINE(HAVE_KRB5)
196 KRB5_LDADD=-lkrb5
197 krb_msg=Yes
198fi
199AC_SUBST([KRB5_LDADD])
200
0c1a8103 201# Misc. functions checks
d3372da9 202AC_CHECK_FUNC(vswprintf, , AC_MSG_ERROR([*** must have vswprintf]))
203AH_TEMPLATE(HAVE_WCSCASECMP, [define if your system implements wcscasecmp])
204AC_CHECK_FUNC(wcscasecmp, [ AC_DEFINE(HAVE_WCSCASECMP) ])
205
206AH_TEMPLATE(HAVE_LINUX_SOCKIOS_H, [define if you have linux/sockios.h on your system])
207AC_CHECK_HEADER([linux/sockios.h], [ AC_DEFINE(HAVE_LINUX_SOCKIOS_H) ])
208
209AH_TEMPLATE(HAVE_IPV6, [define if your system supports IPv6 and you wish to compile with support for it])
210AC_CHECK_MEMBER(struct sockaddr_in6.sin6_family, [ AC_DEFINE(HAVE_IPV6) ], , [#include <netinet/in.h>])
211
212AH_TEMPLATE(HAVE_RESOLVER, [define if your system supports the res_* functions to fetch DNS RRs])
213AC_CHECK_LIB(resolv, res_query, [ AC_DEFINE(HAVE_RESOLVER)
214 LDFLAGS="$LDFLAGS -lresolv" ])
57f76d12 215AH_TEMPLATE(HAVE_KEYUTILS, [define if your system supports the Linux keyring functions])
216AC_CHECK_LIB(keyutils, keyctl_search, [ AC_DEFINE(HAVE_KEYUTILS)
217 LDFLAGS="$LDFLAGS -lkeyutils" ])
d3372da9 218
219AC_HEADER_STDC
220AC_HEADER_DIRENT
221AC_HEADER_SYS_WAIT
222
223AC_TYPE_PID_T
224AC_TYPE_SIZE_T
225AC_HEADER_TIME
226AC_TYPE_SIGNAL
227
228CPPFLAGS="-I\$(top_srcdir)/include $CPPFLAGS"
229
230AC_SUBST([clients extlibs])
231AC_OUTPUT([
232Makefile
b43db3fd 233autopackage/Makefile
8b17e919 234common/Makefile
d3372da9 235daemon/Makefile
236lib/Makefile
237lib/guile/Makefile
238lib/guile/dolcon/Makefile
239clients/Makefile
240clients/gtk2/Makefile
241clients/gnome-trans-applet/Makefile
9db6483b 242clients/gaim/Makefile
d3372da9 243include/Makefile
5b5c7760 244include/doldaconnect/Makefile
d9d072f9 245doc/Makefile
e7e96456 246doc/man/Makefile
d3372da9 247po/Makefile.in
248config/Makefile
0870fc19 249contrib/Makefile
d3372da9 250autopackage/dolcon.apspec
5fbecb4f 251autopackage/dcuilib.apspec
252autopackage/dcguile.apspec
d3372da9 253])
254
255echo
256echo "Dolda Connect has been configured with the following settings:"
257echo
258echo " Kerberos 5 support: $krb_msg"
259echo " GTK2 user interface: $gtk2ui_msg"
260echo " GTK2 progress bars: $gtk2pbar_msg"
3589c61e 261echo " Dolconf configurator: $dolconf_msg"
d3372da9 262echo " Guile extension library: $guile_msg"
263echo " GNOME transfer applet: $gnometrapplet_msg"
9db6483b 264echo " Gaim chat plugin: $gaimplugin_msg"
d3372da9 265echo
266
267if tput bold >/dev/null 2>&1 && tty <&2 >/dev/null 2>&1; then
268 hastput=y
269fi
270if test "$HAS_GTK2" = no -a "$with_gtk2" != no -a "$enable_gtk2ui" != no; then
271 if test "$hastput" = y; then
272 tput bold
273 tput setf 4 2>/dev/null
274 fi
275 echo -n " Warning: " >&2
276 if test "$hastput" = y; then
277 tput sgr0
278 fi
279 echo "Could not find a GTK2 development installation on this system." >&2
280 echo " That means you won't get a UI." >&2
281 echo " Make absolutely sure this is what you want!" >&2
282 if test "$hastput" = y; then
283 tput bel
284 fi
285 sleep 1
286fi
287if test "$experimental" = yes; then
288 if test "$hastput" = y; then
289 tput bold
290 tput setf 4 2>/dev/null
291 fi
292 echo -n " Warning: " >&2
293 if test "$hastput" = y; then
294 tput sgr0
295 fi
296 echo "You have enabled one or more experimental features!" >&2
297 echo " Please don't complain that it doesn't work, unless" >&2
298 echo " you have something constructive to add about the situation." >&2
299 if test "$hastput" = y; then
300 tput bel
301 fi
302 sleep 1
303fi