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