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