Added HUP function to dolconf.
[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
75# Gtk GUI check
d3372da9 76gtk2ui_msg=No
77AC_ARG_ENABLE(gtk2ui, [ --enable-gtk2ui Enable the GTK2 user interface])
0c1a8103 78if test "$enable_gtk2ui" = yes; then
f4e3c478 79 if test "$HAS_GTK2" = no; then
0c1a8103 80 AC_MSG_ERROR([*** cannot build the GTK2 UI without a GTK2 library])
81 fi
f4e3c478 82 if test "$HAS_LIBXML" = no; then
0c1a8103 83 AC_MSG_ERROR([*** the GTK2 UI needs libxml2])
84 fi
d3372da9 85fi
86if test "$enable_gtk2ui" != no -a "$HAS_GTK2" = yes; then
87 clients="$clients gtk2"
88 gtk2ui_msg=Yes
89fi
90
3589c61e 91# Dolconf check
92dolconf_msg=No
93AC_ARG_ENABLE(dolconf, [ --enable-dolconf Build the configuration helper])
94if test "$enable_dolconf" = yes -a "$HAS_GTK2" = no; then
95 AC_MSG_ERROR([*** cannot build dolconf without GTK2])
96fi
97if test "$enable_dolconf" != no -a "$HAS_GTK2" = yes; then
98 AM_CONDITIONAL(DOLCONF, true)
99 dolconf_msg=Yes
100else
101 AM_CONDITIONAL(DOLCONF, false)
102fi
103
0c1a8103 104# Gtk progress bar check
d3372da9 105gtk2pbar_msg=No
106AH_TEMPLATE(ENABLE_GTK2PBAR, [define to compile GTK2 progress bars (experimental)])
107AC_ARG_ENABLE(gtk2pbar, [ --enable-gtk2pbar Enable GTK2 progress bars (experimental)])
108if test "$enable_gtk2pbar" = yes; then
109 if test "$HAS_GTK2" = no; then
110 AC_MSG_ERROR([*** cannot build GTK2 progress bars without GTK2])
111 fi
112 experimental=yes
113 gtk2pbar_msg=Yes
114 AC_DEFINE(ENABLE_GTK2PBAR)
115fi
116
0c1a8103 117# Gnome applet check
d3372da9 118gnometrapplet_msg=No
119AC_ARG_ENABLE(gnomeapplet, [ --enable-gnomeapplet Enable GNOME transfer applet (experimental)])
120if test "$enable_gnomeapplet" = yes; then
121 experimental=yes
122 gnometrapplet_msg=Yes
123 clients="$clients gnome-trans-applet"
124fi
125
0c1a8103 126# Gaim plugin check
9db6483b 127gaimplugin_msg=No
128AC_ARG_ENABLE(gaimplugin, [ --enable-gaimplugin Enable GNOME transfer applet (experimental)])
129if test "$enable_gaimplugin" = yes; then
130 experimental=yes
131 gaimplugin_msg=Yes
132 clients="$clients gaim"
133fi
134
0c1a8103 135# Guile check (XXX: Shouldn't have to be enabled manually)
d3372da9 136guile_msg=No
137if test "$with_guile" = yes; then
138 GUILE_FLAGS
139 extlibs="$extlibs guile"
140 guile_msg=Yes
141fi
142
72e3daf5 143# Check whether to install baseconv
144AC_ARG_ENABLE(baseconv, [ --enable-baseconv Install the baseconv utility])
a1b1a665 145AM_CONDITIONAL(BASECONV, test "$enable_baseconv" = yes)
72e3daf5 146
0c1a8103 147# Kerberos check
d3372da9 148krb_msg=No
149AH_TEMPLATE(HAVE_KRB5, [define to compile support for Kerberos 5 (not GSS-API) authentication])
150AC_ARG_WITH(krb5, [ --with-krb5[=PATH] Enable Kerberos 5 (not GSSAPI) authentication])
151if test "$with_krb5" != no; then
152 cpp_bak="$CPPFLAGS"
153 ld_bak="$LDFLAGS"
154 if test "$with_krb5" != yes; then
155 CPPFLAGS="$CPPFLAGS -I${with_krb5}/include"
156 LDFLAGS="$LDFLAGS -L${with_krb5}/lib"
157 fi
158 AC_CHECK_LIB(krb5, krb5_init_context, [HAS_KRB5=yes], [HAS_KRB5=no])
159 if test "$HAS_KRB5" = yes; then
160 AC_CHECK_HEADER(com_err.h, [HAS_COMERR=yes], [HAS_COMERR=no])
161 if test "$HAS_COMERR" = no; then
162 AC_CHECK_HEADER(et/com_err.h, [HAS_COMERR=yes; CPPFLAGS="$CPPFLAGS -I/usr/include/et"], [])
163 fi
164 fi
165 if test "$HAS_COMERR" = no; then
166 HAS_KRB5=no
167 fi
168 if test "$HAS_KRB5" = no; then
169 CPPFLAGS="$cpp_bak"
170 LDFLAGS="$ld_bak"
171 fi
172fi
173KRB5_LDADD=
174if test -n "$with_krb5" -a "$with_krb5" != no -a "$HAS_KRB5" != yes; then
175 AC_MSG_ERROR([*** cannot find Kerberos 5 on this system - try passing --with-krb5=/path/to/kerberos])
176fi
177if test "$with_krb5" != no -a "$HAS_KRB5" = yes; then
178 AC_DEFINE(HAVE_KRB5)
179 KRB5_LDADD=-lkrb5
180 krb_msg=Yes
181fi
182AC_SUBST([KRB5_LDADD])
183
0c1a8103 184# Misc. functions checks
d3372da9 185AC_CHECK_FUNC(vswprintf, , AC_MSG_ERROR([*** must have vswprintf]))
186AH_TEMPLATE(HAVE_WCSCASECMP, [define if your system implements wcscasecmp])
187AC_CHECK_FUNC(wcscasecmp, [ AC_DEFINE(HAVE_WCSCASECMP) ])
188
189AH_TEMPLATE(HAVE_LINUX_SOCKIOS_H, [define if you have linux/sockios.h on your system])
190AC_CHECK_HEADER([linux/sockios.h], [ AC_DEFINE(HAVE_LINUX_SOCKIOS_H) ])
191
192AH_TEMPLATE(HAVE_IPV6, [define if your system supports IPv6 and you wish to compile with support for it])
193AC_CHECK_MEMBER(struct sockaddr_in6.sin6_family, [ AC_DEFINE(HAVE_IPV6) ], , [#include <netinet/in.h>])
194
195AH_TEMPLATE(HAVE_RESOLVER, [define if your system supports the res_* functions to fetch DNS RRs])
196AC_CHECK_LIB(resolv, res_query, [ AC_DEFINE(HAVE_RESOLVER)
197 LDFLAGS="$LDFLAGS -lresolv" ])
57f76d12 198AH_TEMPLATE(HAVE_KEYUTILS, [define if your system supports the Linux keyring functions])
199AC_CHECK_LIB(keyutils, keyctl_search, [ AC_DEFINE(HAVE_KEYUTILS)
200 LDFLAGS="$LDFLAGS -lkeyutils" ])
d3372da9 201
202AC_HEADER_STDC
203AC_HEADER_DIRENT
204AC_HEADER_SYS_WAIT
205
206AC_TYPE_PID_T
207AC_TYPE_SIZE_T
208AC_HEADER_TIME
209AC_TYPE_SIGNAL
210
211CPPFLAGS="-I\$(top_srcdir)/include $CPPFLAGS"
212
213AC_SUBST([clients extlibs])
214AC_OUTPUT([
215Makefile
b43db3fd 216autopackage/Makefile
8b17e919 217common/Makefile
d3372da9 218daemon/Makefile
219lib/Makefile
220lib/guile/Makefile
221lib/guile/dolcon/Makefile
222clients/Makefile
223clients/gtk2/Makefile
224clients/gnome-trans-applet/Makefile
9db6483b 225clients/gaim/Makefile
d3372da9 226include/Makefile
5b5c7760 227include/doldaconnect/Makefile
d9d072f9 228doc/Makefile
e7e96456 229doc/man/Makefile
d3372da9 230po/Makefile.in
231config/Makefile
0870fc19 232contrib/Makefile
d3372da9 233autopackage/dolcon.apspec
5fbecb4f 234autopackage/dcuilib.apspec
235autopackage/dcguile.apspec
d3372da9 236])
237
238echo
239echo "Dolda Connect has been configured with the following settings:"
240echo
241echo " Kerberos 5 support: $krb_msg"
242echo " GTK2 user interface: $gtk2ui_msg"
243echo " GTK2 progress bars: $gtk2pbar_msg"
3589c61e 244echo " Dolconf configurator: $dolconf_msg"
d3372da9 245echo " Guile extension library: $guile_msg"
246echo " GNOME transfer applet: $gnometrapplet_msg"
9db6483b 247echo " Gaim chat plugin: $gaimplugin_msg"
d3372da9 248echo
249
250if tput bold >/dev/null 2>&1 && tty <&2 >/dev/null 2>&1; then
251 hastput=y
252fi
253if test "$HAS_GTK2" = no -a "$with_gtk2" != no -a "$enable_gtk2ui" != no; then
254 if test "$hastput" = y; then
255 tput bold
256 tput setf 4 2>/dev/null
257 fi
258 echo -n " Warning: " >&2
259 if test "$hastput" = y; then
260 tput sgr0
261 fi
262 echo "Could not find a GTK2 development installation on this system." >&2
263 echo " That means you won't get a UI." >&2
264 echo " Make absolutely sure this is what you want!" >&2
265 if test "$hastput" = y; then
266 tput bel
267 fi
268 sleep 1
269fi
270if test "$experimental" = yes; 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 "You have enabled one or more experimental features!" >&2
280 echo " Please don't complain that it doesn't work, unless" >&2
281 echo " you have something constructive to add about the situation." >&2
282 if test "$hastput" = y; then
283 tput bel
284 fi
285 sleep 1
286fi