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]))
26 AC_CHECK_PROG([PKG_CONFIG], pkg-config, yes, no)
29 AC_ARG_WITH(gtk2, [ --with-gtk2 Enable GTK2 support])
30 if test "$with_gtk2" = no; then
33 if test "$HAS_GTK2" != no; then
34 if test "$PKG_CONFIG" = yes; then
35 AC_MSG_CHECKING([for GTK2 package information])
36 if pkg-config --modversion gtk+-2.0 >/dev/null 2>&1; then
42 GTK2_LDADD="`pkg-config --libs gtk+-2.0`"
43 GTK2_CFLAGS="`pkg-config --cflags gtk+-2.0`"
44 if test "$HAS_GTK2" != no; then
45 AC_CHECK_LIB(gtk-x11-2.0, gtk_init, [HAS_GTK2=yes], [HAS_GTK2=no], "$GTK2_LDADD")
47 if test "$HAS_GTK2" = yes; then
49 CPPFLAGS="$CPPFLAGS $GTK2_CFLAGS"
50 AC_CHECK_HEADER(gtk/gtk.h, [], [HAS_GTK2=no])
57 if test "$with_gtk2" = yes -a "$HAS_GTK2" = no; then
58 AC_MSG_ERROR([*** cannot find GTK2 on this system])
60 AC_SUBST([GTK2_LDADD GTK2_CFLAGS])
63 AC_MSG_CHECKING([for libxml2 package information])
64 if test "$PKG_CONFIG" = yes; then
65 if pkg-config --modversion libxml-2.0 >/dev/null 2>&1; then
71 LIBXML_LDADD="`pkg-config --libs libxml-2.0`"
72 LIBXML_CFLAGS="`pkg-config --cflags libxml-2.0`"
73 if test "$HAS_LIBXML" != no; then
74 AC_CHECK_LIB(xml2, xmlReadFile, [HAS_LIBXML=yes], [HAS_LIBXML=no], "$LIBXML_LDADD")
80 AC_SUBST([LIBXML_LDADD LIBXML_CFLAGS])
83 AC_MSG_CHECKING([for libnotify package information])
84 if test "$PKG_CONFIG" = yes; then
85 if pkg-config --modversion libnotify >/dev/null 2>&1; then
95 if test "$HAS_LIBNOTIFY" != no; then
96 AC_CHECK_LIB(notify, notify_init, [HAS_LIBNOTIFY=yes], [HAS_LIBNOTIFY=no], `pkg-config --libs libnotify`)
101 AC_ARG_ENABLE(gtk2ui, [ --enable-gtk2ui Enable the GTK2 user interface])
102 if test "$enable_gtk2ui" = yes; then
103 if test "$HAS_GTK2" = no; then
104 AC_MSG_ERROR([*** cannot build the GTK2 UI without a GTK2 library])
106 if test "$HAS_LIBXML" = no; then
107 AC_MSG_ERROR([*** the GTK2 UI needs libxml2])
110 if test "$enable_gtk2ui" != no -a "$HAS_GTK2" = yes -a "$HAS_LIBXML" = yes; then
113 AM_CONDITIONAL(CLI_GTK2, test "$gtk2ui_msg" = Yes)
117 AC_ARG_ENABLE(dolconf, [ --enable-dolconf Build the configuration helper])
118 if test "$enable_dolconf" = yes -a "$HAS_GTK2" = no; then
119 AC_MSG_ERROR([*** cannot build dolconf without GTK2])
121 if test "$enable_dolconf" != no -a "$HAS_GTK2" = yes; then
124 AM_CONDITIONAL(DOLCONF, test "$dolconf_msg" = Yes)
126 # Gtk progress bar check
128 AH_TEMPLATE(ENABLE_GTK2PBAR, [define to compile GTK2 progress bars (experimental)])
129 AC_ARG_ENABLE(gtk2pbar, [ --enable-gtk2pbar Enable GTK2 progress bars (experimental)])
130 if test "$enable_gtk2pbar" = yes; then
131 if test "$HAS_GTK2" = no; then
132 AC_MSG_ERROR([*** cannot build GTK2 progress bars without GTK2])
136 AC_DEFINE(ENABLE_GTK2PBAR)
141 AC_ARG_ENABLE(gnomeapplet, [ --enable-gnomeapplet Enable GNOME transfer applet (experimental)])
142 if test "$enable_gnomeapplet" = yes; then
144 gnometrapplet_msg=Yes
146 AM_CONDITIONAL(CLI_GNOMEAPPLET, test "$gnometrapplet_msg" = Yes)
150 AC_ARG_ENABLE(gaimplugin, [ --enable-gaimplugin Enable GNOME transfer applet (experimental)])
151 if test "$enable_gaimplugin" = yes; then
155 AM_CONDITIONAL(CLI_GAIM, test "$gaimplugin_msg" = Yes)
157 # Guile check (XXX: Shouldn't have to be enabled manually)
159 if test "$with_guile" = yes; then
161 extlibs="$extlibs guile"
165 # Check whether to install baseconv
166 AC_ARG_ENABLE(baseconv, [ --enable-baseconv Install the baseconv utility])
167 AM_CONDITIONAL(BASECONV, test "$enable_baseconv" = yes)
171 AH_TEMPLATE(HAVE_KRB5, [define to compile support for Kerberos 5 (not GSS-API) authentication])
172 AC_ARG_WITH(krb5, [ --with-krb5[=PATH] Enable Kerberos 5 (not GSSAPI) authentication])
173 if test "$with_krb5" != no; then
176 if test "$with_krb5" != yes; then
177 CPPFLAGS="$CPPFLAGS -I${with_krb5}/include"
178 LDFLAGS="$LDFLAGS -L${with_krb5}/lib"
180 AC_CHECK_LIB(krb5, krb5_init_context, [HAS_KRB5=yes], [HAS_KRB5=no])
181 if test "$HAS_KRB5" = yes; then
182 AC_CHECK_HEADER(com_err.h, [HAS_COMERR=yes], [HAS_COMERR=no])
183 if test "$HAS_COMERR" = no; then
184 AC_CHECK_HEADER(et/com_err.h, [HAS_COMERR=yes; CPPFLAGS="$CPPFLAGS -I/usr/include/et"], [])
187 if test "$HAS_COMERR" = no; then
190 if test "$HAS_KRB5" = no; then
196 if test -n "$with_krb5" -a "$with_krb5" != no -a "$HAS_KRB5" != yes; then
197 AC_MSG_ERROR([*** cannot find Kerberos 5 on this system - try passing --with-krb5=/path/to/kerberos])
199 if test "$with_krb5" != no -a "$HAS_KRB5" = yes; then
204 AC_SUBST([KRB5_LDADD])
206 # Misc. functions checks
207 AC_CHECK_FUNC(vswprintf, , AC_MSG_ERROR([*** must have vswprintf]))
208 AH_TEMPLATE(HAVE_WCSCASECMP, [define if your system implements wcscasecmp])
209 AC_CHECK_FUNC(wcscasecmp, [ AC_DEFINE(HAVE_WCSCASECMP) ])
211 AH_TEMPLATE(HAVE_LINUX_SOCKIOS_H, [define if you have linux/sockios.h on your system])
212 AC_CHECK_HEADER([linux/sockios.h], [ AC_DEFINE(HAVE_LINUX_SOCKIOS_H) ])
214 AH_TEMPLATE(HAVE_IPV6, [define if your system supports IPv6 and you wish to compile with support for it])
215 AC_CHECK_MEMBER(struct sockaddr_in6.sin6_family, [ AC_DEFINE(HAVE_IPV6) ], , [#include <netinet/in.h>])
217 AH_TEMPLATE(HAVE_RESOLVER, [define if your system supports the res_* functions to fetch DNS RRs])
218 AC_CHECK_LIB(resolv, res_query, [ AC_DEFINE(HAVE_RESOLVER)
219 LDFLAGS="$LDFLAGS -lresolv" ])
220 AH_TEMPLATE(HAVE_KEYUTILS, [define if your system supports the Linux keyring functions])
221 AC_CHECK_LIB(keyutils, keyctl_search, [ AC_DEFINE(HAVE_KEYUTILS)
222 LDFLAGS="$LDFLAGS -lkeyutils" ])
224 # Unix credentials selector
225 AH_TEMPLATE(UNIX_AUTH_STYLE, [undefine for no Unix auth, 1 for Linux style, 2 for BSD style])
226 AC_CHECK_MEMBER(struct ucred.pid, [ linuxcreds=y ], [ linuxcreds=n ], [#include <sys/socket.h>])
227 AC_CHECK_FUNC(getpeereid, [ bsdcreds=y ], [ bsdcreds=n ])
228 AC_MSG_CHECKING([for Unix auth style])
229 if test $linuxcreds = y; then
230 AC_DEFINE(UNIX_AUTH_STYLE, 1)
232 elif test $bsdcreds = y; then
233 AC_DEFINE(UNIX_AUTH_STYLE, 2)
248 CPPFLAGS="-I\$(top_srcdir)/include $CPPFLAGS"
258 lib/guile/dolcon/Makefile
260 clients/gtk2/Makefile
262 clients/gnome-trans-applet/Makefile
263 clients/gaim/Makefile
265 include/doldaconnect/Makefile
271 autopackage/dolcon.apspec
272 autopackage/dcuilib.apspec
273 autopackage/dcguile.apspec
277 echo "Dolda Connect has been configured with the following settings:"
279 echo " Kerberos 5 support: $krb_msg"
280 echo " GTK2 user interface: $gtk2ui_msg"
281 echo " GTK2 progress bars: $gtk2pbar_msg"
282 echo " Dolconf configurator: $dolconf_msg"
283 echo " Guile extension library: $guile_msg"
284 echo " GNOME transfer applet: $gnometrapplet_msg"
285 echo " Gaim chat plugin: $gaimplugin_msg"
288 if tput bold >/dev/null 2>&1 && tty <&2 >/dev/null 2>&1; then
291 if test "$HAS_GTK2" = no -a "$with_gtk2" != no -a "$enable_gtk2ui" != no; then
292 if test "$hastput" = y; then
294 tput setf 4 2>/dev/null
296 echo -n " Warning: " >&2
297 if test "$hastput" = y; then
300 echo "Could not find a GTK2 development installation on this system." >&2
301 echo " That means you won't get a UI." >&2
302 echo " Make absolutely sure this is what you want!" >&2
303 if test "$hastput" = y; then
308 if test "$experimental" = yes; then
309 if test "$hastput" = y; then
311 tput setf 4 2>/dev/null
313 echo -n " Warning: " >&2
314 if test "$hastput" = y; then
317 echo "You have enabled one or more experimental features!" >&2
318 echo " Please don't complain that it doesn't work, unless" >&2
319 echo " you have something constructive to add about the situation." >&2
320 if test "$hastput" = y; then