2 AM_INIT_AUTOMAKE([doldaconnect], [0.4])
3 AM_CONFIG_HEADER(config.h)
10 AM_GNU_GETTEXT_VERSION(0.12.1)
11 AM_GNU_GETTEXT([external])
13 # Temporary hack to make libtool not check for g++ or g77
14 m4_defun([_LT_AC_LANG_CXX_CONFIG], true)
15 m4_defun([_LT_AC_LANG_F77_CONFIG], true)
18 AC_CHECK_LIB(pam, pam_start, , AC_MSG_ERROR([*** must have PAM]))
19 AC_CHECK_LIB(z, deflate, , AC_MSG_ERROR([*** must have zlib]))
20 AC_CHECK_LIB(bz2, BZ2_bzWriteOpen, , AC_MSG_ERROR([*** must have bzlib]))
21 AC_CHECK_LIB(gdbm, gdbm_open, , AC_MSG_ERROR([*** must have gdbm]))
27 AC_CHECK_PROG([PKG_CONFIG], pkg-config, yes, no)
30 AC_ARG_WITH(gtk2, [ --with-gtk2 Enable GTK2 support])
31 if test "$with_gtk2" = no; then
34 if test "$HAS_GTK2" != no; then
35 if test "$PKG_CONFIG" = yes; then
36 AC_MSG_CHECKING([for GTK2 package information])
37 if pkg-config --modversion gtk+-2.0 >/dev/null 2>&1; then
43 GTK2_LDADD="`pkg-config --libs gtk+-2.0`"
44 GTK2_CFLAGS="`pkg-config --cflags gtk+-2.0`"
45 if test "$HAS_GTK2" != no; then
46 AC_CHECK_LIB(gtk-x11-2.0, gtk_init, [HAS_GTK2=yes], [HAS_GTK2=no], "$GTK2_LDADD")
48 if test "$HAS_GTK2" = yes; then
50 CPPFLAGS="$CPPFLAGS $GTK2_CFLAGS"
51 AC_CHECK_HEADER(gtk/gtk.h, [], [HAS_GTK2=no])
58 if test "$with_gtk2" = yes -a "$HAS_GTK2" = no; then
59 AC_MSG_ERROR([*** cannot find GTK2 on this system])
61 AC_SUBST([GTK2_LDADD GTK2_CFLAGS])
64 AC_MSG_CHECKING([for libxml2 package information])
65 if test "$PKG_CONFIG" = yes; then
66 if pkg-config --modversion libxml-2.0 >/dev/null 2>&1; then
72 LIBXML_LDADD="`pkg-config --libs libxml-2.0`"
73 LIBXML_CFLAGS="`pkg-config --cflags libxml-2.0`"
74 if test "$HAS_LIBXML" != no; then
75 AC_CHECK_LIB(xml2, xmlReadFile, [HAS_LIBXML=yes], [HAS_LIBXML=no], "$LIBXML_LDADD")
81 AC_SUBST([LIBXML_LDADD LIBXML_CFLAGS])
84 AC_MSG_CHECKING([for libnotify package information])
85 if test "$PKG_CONFIG" = yes; then
86 if pkg-config --modversion libnotify >/dev/null 2>&1; then
96 if test "$HAS_LIBNOTIFY" != no; then
97 AC_CHECK_LIB(notify, notify_init, [HAS_LIBNOTIFY=yes], [HAS_LIBNOTIFY=no], `pkg-config --libs libnotify`)
102 AC_ARG_ENABLE(gtk2ui, [ --enable-gtk2ui Enable the GTK2 user interface])
103 if test "$enable_gtk2ui" = yes; then
104 if test "$HAS_GTK2" = no; then
105 AC_MSG_ERROR([*** cannot build the GTK2 UI without a GTK2 library])
107 if test "$HAS_LIBXML" = no; then
108 AC_MSG_ERROR([*** the GTK2 UI needs libxml2])
111 if test "$enable_gtk2ui" != no -a "$HAS_GTK2" = yes; then
112 clients="$clients gtk2"
118 AC_ARG_ENABLE(dolconf, [ --enable-dolconf Build the configuration helper])
119 if test "$enable_dolconf" = yes -a "$HAS_GTK2" = no; then
120 AC_MSG_ERROR([*** cannot build dolconf without GTK2])
122 if test "$enable_dolconf" != no -a "$HAS_GTK2" = yes; then
123 AM_CONDITIONAL(DOLCONF, true)
126 AM_CONDITIONAL(DOLCONF, false)
129 # Gtk progress bar check
131 AH_TEMPLATE(ENABLE_GTK2PBAR, [define to compile GTK2 progress bars (experimental)])
132 AC_ARG_ENABLE(gtk2pbar, [ --enable-gtk2pbar Enable GTK2 progress bars (experimental)])
133 if test "$enable_gtk2pbar" = yes; then
134 if test "$HAS_GTK2" = no; then
135 AC_MSG_ERROR([*** cannot build GTK2 progress bars without GTK2])
139 AC_DEFINE(ENABLE_GTK2PBAR)
144 AC_ARG_ENABLE(gnomeapplet, [ --enable-gnomeapplet Enable GNOME transfer applet (experimental)])
145 if test "$enable_gnomeapplet" = yes; then
147 gnometrapplet_msg=Yes
148 clients="$clients gnome-trans-applet"
153 AC_ARG_ENABLE(gaimplugin, [ --enable-gaimplugin Enable GNOME transfer applet (experimental)])
154 if test "$enable_gaimplugin" = yes; then
157 clients="$clients gaim"
160 # Guile check (XXX: Shouldn't have to be enabled manually)
162 if test "$with_guile" = yes; then
164 extlibs="$extlibs guile"
168 # Check whether to install baseconv
169 AC_ARG_ENABLE(baseconv, [ --enable-baseconv Install the baseconv utility])
170 AM_CONDITIONAL(BASECONV, test "$enable_baseconv" = yes)
174 AH_TEMPLATE(HAVE_KRB5, [define to compile support for Kerberos 5 (not GSS-API) authentication])
175 AC_ARG_WITH(krb5, [ --with-krb5[=PATH] Enable Kerberos 5 (not GSSAPI) authentication])
176 if test "$with_krb5" != no; then
179 if test "$with_krb5" != yes; then
180 CPPFLAGS="$CPPFLAGS -I${with_krb5}/include"
181 LDFLAGS="$LDFLAGS -L${with_krb5}/lib"
183 AC_CHECK_LIB(krb5, krb5_init_context, [HAS_KRB5=yes], [HAS_KRB5=no])
184 if test "$HAS_KRB5" = yes; then
185 AC_CHECK_HEADER(com_err.h, [HAS_COMERR=yes], [HAS_COMERR=no])
186 if test "$HAS_COMERR" = no; then
187 AC_CHECK_HEADER(et/com_err.h, [HAS_COMERR=yes; CPPFLAGS="$CPPFLAGS -I/usr/include/et"], [])
190 if test "$HAS_COMERR" = no; then
193 if test "$HAS_KRB5" = no; then
199 if test -n "$with_krb5" -a "$with_krb5" != no -a "$HAS_KRB5" != yes; then
200 AC_MSG_ERROR([*** cannot find Kerberos 5 on this system - try passing --with-krb5=/path/to/kerberos])
202 if test "$with_krb5" != no -a "$HAS_KRB5" = yes; then
207 AC_SUBST([KRB5_LDADD])
209 # Misc. functions checks
210 AC_CHECK_FUNC(vswprintf, , AC_MSG_ERROR([*** must have vswprintf]))
211 AH_TEMPLATE(HAVE_WCSCASECMP, [define if your system implements wcscasecmp])
212 AC_CHECK_FUNC(wcscasecmp, [ AC_DEFINE(HAVE_WCSCASECMP) ])
214 AH_TEMPLATE(HAVE_LINUX_SOCKIOS_H, [define if you have linux/sockios.h on your system])
215 AC_CHECK_HEADER([linux/sockios.h], [ AC_DEFINE(HAVE_LINUX_SOCKIOS_H) ])
217 AH_TEMPLATE(HAVE_IPV6, [define if your system supports IPv6 and you wish to compile with support for it])
218 AC_CHECK_MEMBER(struct sockaddr_in6.sin6_family, [ AC_DEFINE(HAVE_IPV6) ], , [#include <netinet/in.h>])
220 AH_TEMPLATE(HAVE_RESOLVER, [define if your system supports the res_* functions to fetch DNS RRs])
221 AC_CHECK_LIB(resolv, res_query, [ AC_DEFINE(HAVE_RESOLVER)
222 LDFLAGS="$LDFLAGS -lresolv" ])
223 AH_TEMPLATE(HAVE_KEYUTILS, [define if your system supports the Linux keyring functions])
224 AC_CHECK_LIB(keyutils, keyctl_search, [ AC_DEFINE(HAVE_KEYUTILS)
225 LDFLAGS="$LDFLAGS -lkeyutils" ])
227 # Unix credentials selector
228 AH_TEMPLATE(UNIX_AUTH_STYLE, [undefine for no Unix auth, 1 for Linux style, 2 for BSD style])
229 AC_CHECK_MEMBER(struct ucred.pid, [ linuxcreds=y ], [ linuxcreds=n ], [#include <sys/socket.h>])
230 AC_CHECK_FUNC(getpeereid, [ bsdcreds=y ], [ bsdcreds=n ])
231 AC_MSG_CHECKING([for Unix auth style])
232 if test $linuxcreds = y; then
233 AC_DEFINE(UNIX_AUTH_STYLE, 1)
235 elif test $bsdcreds = y; then
236 AC_DEFINE(UNIX_AUTH_STYLE, 2)
251 CPPFLAGS="-I\$(top_srcdir)/include $CPPFLAGS"
253 AC_SUBST([clients extlibs])
261 lib/guile/dolcon/Makefile
263 clients/gtk2/Makefile
265 clients/gnome-trans-applet/Makefile
266 clients/gaim/Makefile
268 include/doldaconnect/Makefile
274 autopackage/dolcon.apspec
275 autopackage/dcuilib.apspec
276 autopackage/dcguile.apspec
280 echo "Dolda Connect has been configured with the following settings:"
282 echo " Kerberos 5 support: $krb_msg"
283 echo " GTK2 user interface: $gtk2ui_msg"
284 echo " GTK2 progress bars: $gtk2pbar_msg"
285 echo " Dolconf configurator: $dolconf_msg"
286 echo " Guile extension library: $guile_msg"
287 echo " GNOME transfer applet: $gnometrapplet_msg"
288 echo " Gaim chat plugin: $gaimplugin_msg"
291 if tput bold >/dev/null 2>&1 && tty <&2 >/dev/null 2>&1; then
294 if test "$HAS_GTK2" = no -a "$with_gtk2" != no -a "$enable_gtk2ui" != no; then
295 if test "$hastput" = y; then
297 tput setf 4 2>/dev/null
299 echo -n " Warning: " >&2
300 if test "$hastput" = y; then
303 echo "Could not find a GTK2 development installation on this system." >&2
304 echo " That means you won't get a UI." >&2
305 echo " Make absolutely sure this is what you want!" >&2
306 if test "$hastput" = y; then
311 if test "$experimental" = yes; then
312 if test "$hastput" = y; then
314 tput setf 4 2>/dev/null
316 echo -n " Warning: " >&2
317 if test "$hastput" = y; then
320 echo "You have enabled one or more experimental features!" >&2
321 echo " Please don't complain that it doesn't work, unless" >&2
322 echo " you have something constructive to add about the situation." >&2
323 if test "$hastput" = y; then