Continued data model docs.
[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
3be6a9b7 6AC_PROG_CC_C_O
7AM_PROG_CC_C_O
d3372da9 8AC_PROG_INSTALL
9
10AM_GNU_GETTEXT_VERSION(0.12.1)
11AM_GNU_GETTEXT([external])
5d0dcf5c 12
13# Temporary hack to make libtool not check for g++ or g77
14m4_defun([_LT_AC_LANG_CXX_CONFIG], true)
15m4_defun([_LT_AC_LANG_F77_CONFIG], true)
a47ecc70 16AC_PROG_LIBTOOL
d3372da9 17
18AC_CHECK_LIB(pam, pam_start, , AC_MSG_ERROR([*** must have PAM]))
d3372da9 19AC_CHECK_LIB(z, deflate, , AC_MSG_ERROR([*** must have zlib]))
20AC_CHECK_LIB(bz2, BZ2_bzWriteOpen, , AC_MSG_ERROR([*** must have bzlib]))
05fe12f8 21AC_CHECK_LIB(gdbm, gdbm_open, , AC_MSG_ERROR([*** must have gdbm]))
d3372da9 22
a24f31ec 23clients=tty
d3372da9 24extlibs=
25experimental=no
26
27AC_CHECK_PROG([PKG_CONFIG], pkg-config, yes, no)
28
0c1a8103 29# Gtk 2.0 check
d3372da9 30AC_ARG_WITH(gtk2, [ --with-gtk2 Enable GTK2 support])
31if test "$with_gtk2" = no; then
32 HAS_GTK2=no
33fi
34if 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
38 AC_MSG_RESULT(yes)
39 else
40 AC_MSG_RESULT(no)
41 HAS_GTK2=no
42 fi
3be6a9b7 43 GTK2_LDADD="`pkg-config --libs gtk+-2.0`"
44 GTK2_CFLAGS="`pkg-config --cflags gtk+-2.0`"
d3372da9 45 if test "$HAS_GTK2" != no; then
3be6a9b7 46 AC_CHECK_LIB(gtk-x11-2.0, gtk_init, [HAS_GTK2=yes], [HAS_GTK2=no], "$GTK2_LDADD")
d3372da9 47 fi
48 if test "$HAS_GTK2" = yes; then
49 cpp_bak="$CPPFLAGS"
3be6a9b7 50 CPPFLAGS="$CPPFLAGS $GTK2_CFLAGS"
d3372da9 51 AC_CHECK_HEADER(gtk/gtk.h, [], [HAS_GTK2=no])
52 CPPFLAGS="$cpp_bak"
53 fi
54 else
55 HAS_GTK2=no
56 fi
57fi
58if test "$with_gtk2" = yes -a "$HAS_GTK2" = no; then
59 AC_MSG_ERROR([*** cannot find GTK2 on this system])
60fi
3be6a9b7 61AC_SUBST([GTK2_LDADD GTK2_CFLAGS])
d3372da9 62
0c1a8103 63# libxml2 check
64AC_MSG_CHECKING([for libxml2 package information])
65if test "$PKG_CONFIG" = yes; then
66 if pkg-config --modversion libxml-2.0 >/dev/null 2>&1; then
67 AC_MSG_RESULT(yes)
68 else
69 AC_MSG_RESULT(no)
70 HAS_LIBXML=no
71 fi
3be6a9b7 72 LIBXML_LDADD="`pkg-config --libs libxml-2.0`"
73 LIBXML_CFLAGS="`pkg-config --cflags libxml-2.0`"
0c1a8103 74 if test "$HAS_LIBXML" != no; then
3be6a9b7 75 AC_CHECK_LIB(xml2, xmlReadFile, [HAS_LIBXML=yes], [HAS_LIBXML=no], "$LIBXML_LDADD")
0c1a8103 76 fi
77else
78 AC_MSG_RESULT(no)
79 HAS_LIBXML=no
80fi
3be6a9b7 81AC_SUBST([LIBXML_LDADD LIBXML_CFLAGS])
0c1a8103 82
bbc9d874 83# libnotify check
84AC_MSG_CHECKING([for libnotify package information])
85if test "$PKG_CONFIG" = yes; then
86 if pkg-config --modversion libnotify >/dev/null 2>&1; then
87 AC_MSG_RESULT(yes)
88 else
89 AC_MSG_RESULT(no)
90 HAS_LIBNOTIFY=no
91 fi
92else
93 AC_MSG_RESULT(no)
94 HAS_LIBNOTIFY=no
95fi
96if test "$HAS_LIBNOTIFY" != no; then
97 AC_CHECK_LIB(notify, notify_init, [HAS_LIBNOTIFY=yes], [HAS_LIBNOTIFY=no], `pkg-config --libs libnotify`)
98fi
99
0c1a8103 100# Gtk GUI check
d3372da9 101gtk2ui_msg=No
102AC_ARG_ENABLE(gtk2ui, [ --enable-gtk2ui Enable the GTK2 user interface])
0c1a8103 103if test "$enable_gtk2ui" = yes; then
f4e3c478 104 if test "$HAS_GTK2" = no; then
0c1a8103 105 AC_MSG_ERROR([*** cannot build the GTK2 UI without a GTK2 library])
106 fi
f4e3c478 107 if test "$HAS_LIBXML" = no; then
0c1a8103 108 AC_MSG_ERROR([*** the GTK2 UI needs libxml2])
109 fi
d3372da9 110fi
111if test "$enable_gtk2ui" != no -a "$HAS_GTK2" = yes; then
112 clients="$clients gtk2"
113 gtk2ui_msg=Yes
114fi
115
3589c61e 116# Dolconf check
117dolconf_msg=No
118AC_ARG_ENABLE(dolconf, [ --enable-dolconf Build the configuration helper])
119if test "$enable_dolconf" = yes -a "$HAS_GTK2" = no; then
120 AC_MSG_ERROR([*** cannot build dolconf without GTK2])
121fi
122if test "$enable_dolconf" != no -a "$HAS_GTK2" = yes; then
123 AM_CONDITIONAL(DOLCONF, true)
124 dolconf_msg=Yes
125else
126 AM_CONDITIONAL(DOLCONF, false)
127fi
128
0c1a8103 129# Gtk progress bar check
d3372da9 130gtk2pbar_msg=No
131AH_TEMPLATE(ENABLE_GTK2PBAR, [define to compile GTK2 progress bars (experimental)])
132AC_ARG_ENABLE(gtk2pbar, [ --enable-gtk2pbar Enable GTK2 progress bars (experimental)])
133if test "$enable_gtk2pbar" = yes; then
134 if test "$HAS_GTK2" = no; then
135 AC_MSG_ERROR([*** cannot build GTK2 progress bars without GTK2])
136 fi
137 experimental=yes
138 gtk2pbar_msg=Yes
139 AC_DEFINE(ENABLE_GTK2PBAR)
140fi
141
0c1a8103 142# Gnome applet check
d3372da9 143gnometrapplet_msg=No
144AC_ARG_ENABLE(gnomeapplet, [ --enable-gnomeapplet Enable GNOME transfer applet (experimental)])
145if test "$enable_gnomeapplet" = yes; then
146 experimental=yes
147 gnometrapplet_msg=Yes
148 clients="$clients gnome-trans-applet"
149fi
150
0c1a8103 151# Gaim plugin check
9db6483b 152gaimplugin_msg=No
153AC_ARG_ENABLE(gaimplugin, [ --enable-gaimplugin Enable GNOME transfer applet (experimental)])
154if test "$enable_gaimplugin" = yes; then
155 experimental=yes
156 gaimplugin_msg=Yes
157 clients="$clients gaim"
158fi
159
0c1a8103 160# Guile check (XXX: Shouldn't have to be enabled manually)
d3372da9 161guile_msg=No
162if test "$with_guile" = yes; then
163 GUILE_FLAGS
164 extlibs="$extlibs guile"
165 guile_msg=Yes
166fi
167
72e3daf5 168# Check whether to install baseconv
169AC_ARG_ENABLE(baseconv, [ --enable-baseconv Install the baseconv utility])
a1b1a665 170AM_CONDITIONAL(BASECONV, test "$enable_baseconv" = yes)
72e3daf5 171
0c1a8103 172# Kerberos check
d3372da9 173krb_msg=No
174AH_TEMPLATE(HAVE_KRB5, [define to compile support for Kerberos 5 (not GSS-API) authentication])
175AC_ARG_WITH(krb5, [ --with-krb5[=PATH] Enable Kerberos 5 (not GSSAPI) authentication])
176if test "$with_krb5" != no; then
177 cpp_bak="$CPPFLAGS"
178 ld_bak="$LDFLAGS"
179 if test "$with_krb5" != yes; then
180 CPPFLAGS="$CPPFLAGS -I${with_krb5}/include"
181 LDFLAGS="$LDFLAGS -L${with_krb5}/lib"
182 fi
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"], [])
188 fi
189 fi
190 if test "$HAS_COMERR" = no; then
191 HAS_KRB5=no
192 fi
193 if test "$HAS_KRB5" = no; then
194 CPPFLAGS="$cpp_bak"
195 LDFLAGS="$ld_bak"
196 fi
197fi
198KRB5_LDADD=
199if 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])
201fi
202if test "$with_krb5" != no -a "$HAS_KRB5" = yes; then
203 AC_DEFINE(HAVE_KRB5)
204 KRB5_LDADD=-lkrb5
205 krb_msg=Yes
206fi
207AC_SUBST([KRB5_LDADD])
208
0c1a8103 209# Misc. functions checks
d3372da9 210AC_CHECK_FUNC(vswprintf, , AC_MSG_ERROR([*** must have vswprintf]))
211AH_TEMPLATE(HAVE_WCSCASECMP, [define if your system implements wcscasecmp])
212AC_CHECK_FUNC(wcscasecmp, [ AC_DEFINE(HAVE_WCSCASECMP) ])
213
214AH_TEMPLATE(HAVE_LINUX_SOCKIOS_H, [define if you have linux/sockios.h on your system])
215AC_CHECK_HEADER([linux/sockios.h], [ AC_DEFINE(HAVE_LINUX_SOCKIOS_H) ])
216
217AH_TEMPLATE(HAVE_IPV6, [define if your system supports IPv6 and you wish to compile with support for it])
218AC_CHECK_MEMBER(struct sockaddr_in6.sin6_family, [ AC_DEFINE(HAVE_IPV6) ], , [#include <netinet/in.h>])
219
220AH_TEMPLATE(HAVE_RESOLVER, [define if your system supports the res_* functions to fetch DNS RRs])
221AC_CHECK_LIB(resolv, res_query, [ AC_DEFINE(HAVE_RESOLVER)
222 LDFLAGS="$LDFLAGS -lresolv" ])
57f76d12 223AH_TEMPLATE(HAVE_KEYUTILS, [define if your system supports the Linux keyring functions])
224AC_CHECK_LIB(keyutils, keyctl_search, [ AC_DEFINE(HAVE_KEYUTILS)
225 LDFLAGS="$LDFLAGS -lkeyutils" ])
d3372da9 226
a8c5ada6 227# Unix credentials selector
228AH_TEMPLATE(UNIX_AUTH_STYLE, [undefine for no Unix auth, 1 for Linux style, 2 for BSD style])
229AC_CHECK_MEMBER(struct ucred.pid, [ linuxcreds=y ], [ linuxcreds=n ], [#include <sys/socket.h>])
230AC_CHECK_FUNC(getpeereid, [ bsdcreds=y ], [ bsdcreds=n ])
231AC_MSG_CHECKING([for Unix auth style])
232if test $linuxcreds = y; then
233 AC_DEFINE(UNIX_AUTH_STYLE, 1)
234 AC_MSG_RESULT(linux)
235elif test $bsdcreds = y; then
236 AC_DEFINE(UNIX_AUTH_STYLE, 2)
237 AC_MSG_RESULT(bsd)
238else
239 AC_MSG_RESULT(none)
240fi
241
d3372da9 242AC_HEADER_STDC
243AC_HEADER_DIRENT
244AC_HEADER_SYS_WAIT
245
246AC_TYPE_PID_T
247AC_TYPE_SIZE_T
248AC_HEADER_TIME
249AC_TYPE_SIGNAL
250
251CPPFLAGS="-I\$(top_srcdir)/include $CPPFLAGS"
252
253AC_SUBST([clients extlibs])
254AC_OUTPUT([
255Makefile
b43db3fd 256autopackage/Makefile
8b17e919 257common/Makefile
d3372da9 258daemon/Makefile
259lib/Makefile
260lib/guile/Makefile
261lib/guile/dolcon/Makefile
262clients/Makefile
263clients/gtk2/Makefile
a24f31ec 264clients/tty/Makefile
d3372da9 265clients/gnome-trans-applet/Makefile
9db6483b 266clients/gaim/Makefile
d3372da9 267include/Makefile
5b5c7760 268include/doldaconnect/Makefile
d9d072f9 269doc/Makefile
e7e96456 270doc/man/Makefile
f11a3675 271doc/protocol/Makefile
d3372da9 272po/Makefile.in
273config/Makefile
0870fc19 274contrib/Makefile
d3372da9 275autopackage/dolcon.apspec
5fbecb4f 276autopackage/dcuilib.apspec
277autopackage/dcguile.apspec
d3372da9 278])
279
280echo
281echo "Dolda Connect has been configured with the following settings:"
282echo
283echo " Kerberos 5 support: $krb_msg"
284echo " GTK2 user interface: $gtk2ui_msg"
285echo " GTK2 progress bars: $gtk2pbar_msg"
3589c61e 286echo " Dolconf configurator: $dolconf_msg"
d3372da9 287echo " Guile extension library: $guile_msg"
288echo " GNOME transfer applet: $gnometrapplet_msg"
9db6483b 289echo " Gaim chat plugin: $gaimplugin_msg"
d3372da9 290echo
291
292if tput bold >/dev/null 2>&1 && tty <&2 >/dev/null 2>&1; then
293 hastput=y
294fi
295if test "$HAS_GTK2" = no -a "$with_gtk2" != no -a "$enable_gtk2ui" != no; then
296 if test "$hastput" = y; then
297 tput bold
298 tput setf 4 2>/dev/null
299 fi
300 echo -n " Warning: " >&2
301 if test "$hastput" = y; then
302 tput sgr0
303 fi
304 echo "Could not find a GTK2 development installation on this system." >&2
305 echo " That means you won't get a UI." >&2
306 echo " Make absolutely sure this is what you want!" >&2
307 if test "$hastput" = y; then
308 tput bel
309 fi
310 sleep 1
311fi
312if test "$experimental" = yes; then
313 if test "$hastput" = y; then
314 tput bold
315 tput setf 4 2>/dev/null
316 fi
317 echo -n " Warning: " >&2
318 if test "$hastput" = y; then
319 tput sgr0
320 fi
321 echo "You have enabled one or more experimental features!" >&2
322 echo " Please don't complain that it doesn't work, unless" >&2
323 echo " you have something constructive to add about the situation." >&2
324 if test "$hastput" = y; then
325 tput bel
326 fi
327 sleep 1
328fi