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