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