e9cdc9218d45f40b24c5022a1d6f42edbe6387b7
[openafs.git] / configure.ac
1 AC_PREREQ([2.60])
2 AC_INIT([OpenAFS],
3     m4_esyscmd([build-tools/git-version .]),
4     [openafs-bugs@openafs.org], [],
5     [http://www.openafs.org/])
6 AC_CONFIG_AUX_DIR([build-tools])
7 AC_CONFIG_MACRO_DIR([src/cf])
8 AC_CONFIG_SRCDIR([src/config/stds.h])
9 AM_INIT_AUTOMAKE([foreign])
10
11 AC_CONFIG_HEADER([src/config/afsconfig.h])
12 MACOS_VERSION=1.5.76
13 #LINUX_PKGREL=0.pre3
14 LINUX_PKGREL=1.1
15
16 dnl Debian wants the release candidate version in the main upstream version,
17 dnl and wants ~ before it.
18 DEB_PKGVER=m4_esyscmd([build-tools/git-version .])
19 AS_IF([echo "$LINUX_PKGREL" | grep pre >/dev/null 2>/dev/null],
20     [DEB_PKGVER="$DEB_PKGVER"`echo "$LINUX_PKGREL" | sed 's/0.pre/~rc/'`])
21
22 AC_SUBST([MACOS_VERSION])
23 AC_SUBST([DEB_PKGVER])
24
25 dnl If the user hasn't specified CFLAGS don't let configure pick -g -O2
26 AS_IF([test -z "$CFLAGS"], [CFLAGS=" "])
27
28 AC_USE_SYSTEM_EXTENSIONS
29
30 LT_INIT
31
32 AC_PROG_CC
33 AC_PROG_LIBTOOL
34
35 AC_PATH_PROGS([PATH_CPP], [cpp], [${CC-cc} -E], [$PATH:/lib:/usr/ccs/lib])
36 AC_SUBST([PATH_CPP])
37 OPENAFS_CONFIGURE_COMMON
38
39 dnl Probe for Kerberos.  We have a few platform-specific overrides due to
40 dnl weird Kerberos implementations and installation locations.
41 AS_CASE([$AFS_SYSNAME],
42     [*_obsd*],
43     [KRB5_CPPFLAGS="-I/usr/include/kerberosV"],
44
45     [ppc_darwin_70],
46     [KRB5_CPPFLAGS="-I/usr/include"
47      KRB5_LDFLAGS="-L/usr/lib -Wl,-search_paths_first"])
48 RRA_LIB_KRB5_OPTIONAL
49 AS_CASE([$AFS_SYSNAME],
50     [hp_ux*|*_hpux*],
51     [KRB5_LIBS="-l:libkrb5.sl -l:libcom_err.sl"])
52
53 dnl Check for the characteristics of whatever Kerberos we found, if we found
54 dnl one.
55 BUILD_KRB5=no
56 MAKE_KRB5="#"
57 AS_IF([test x"$KRB5_LIBS" != x],
58     [BUILD_KRB5=yes
59      MAKE_KRB5=
60      RRA_LIB_KRB5_SWITCH
61      AC_CHECK_FUNCS([add_error_table \
62         add_to_error_table \
63         encode_krb5_enc_tkt_part \
64         encode_krb5_ticket \
65         krb5_524_conv_principal \
66         krb5_allow_weak_crypto \
67         krb5_c_encrypt \
68         krb5_decode_ticket \
69         krb5_enctype_enable \
70         krb5_get_init_creds_opt_alloc \
71         krb5_get_prompt_types \
72         krb5_princ_size \
73         krb5_principal_get_comp_string])
74      AC_CHECK_FUNCS([krb5_524_convert_creds], [],
75         [AC_CHECK_FUNCS([krb524_convert_creds_kdc], [],
76             [AC_CHECK_LIB([krb524], [krb524_convert_creds_kdc],
77                 [LIBS="-lkrb524 $LIBS"
78                  KRB5_LIBS="-lkrb524 $KRB5_LIBS"
79                  AC_CHECK_LIB([krb524], [krb5_524_conv_principal],
80                      [AC_DEFINE([HAVE_KRB5_524_CONV_PRINCIPAL], [1],
81                          [Define to 1 if you have the `krb5_524_conv_principal' function.])
82                  ])
83                  AC_DEFINE([HAVE_KRB524_CONVERT_CREDS_KDC], [1],
84                      [Define to 1 if you have the `krb524_convert_creds_kdc' function.])
85             ])
86         ])
87      ])
88      AC_CHECK_HEADERS([kerberosIV/krb.h])
89      AC_CHECK_HEADERS([kerberosV/heim_err.h])
90      AC_CHECK_HEADERS([com_err.h et/com_err.h krb5/com_err.h])
91      AS_IF([test x"$ac_cv_header_com_err_h" != xyes \
92              && test x"$ac_cv_header_et_com_err_h" != xyes \
93              && test x"$ac_cv_header_krb5_com_err_h" != xyes],
94        [AC_MSG_ERROR([Cannot find a usable com_err.h])])
95      AC_CHECK_MEMBERS([krb5_creds.keyblock, krb5_creds.keyblock.enctype, krb5_creds.session,
96                        krb5_prompt.type], [], [], [#include <krb5.h>])
97 dnl If we have krb5_creds.session, we are using heimdal
98 dnl If we're using heimdal, aklog needs libasn1 for encode_EncTicketPart and a
99 dnl few other functions. But just aklog; not any of the other stuff that uses
100 dnl krb5.
101      AS_IF([test x"$ac_cv_member_krb5_creds_session" = xyes],
102            [AC_CHECK_LIB([asn1], [encode_EncTicketPart],
103                [AKLOG_KRB5_LIBS="-lasn1"])
104      ])
105      RRA_LIB_KRB5_RESTORE
106 ])
107 AC_SUBST([BUILD_KRB5])
108 AC_SUBST([MAKE_KRB5])
109 AC_SUBST([AKLOG_KRB5_LIBS])
110
111 dnl Probe for GSSAPI
112 RRA_LIB_GSSAPI
113 dnl Check for the characteristics of whatever GSSAPI we found, if we found one
114 BUILD_GSSAPI=no
115 AS_IF([test x"$GSSAPI_LIBS" != x],
116     [BUILD_GSSAPI=yes
117      RRA_LIB_GSSAPI_SWITCH
118      AC_CHECK_FUNCS([gss_pseudo_random \
119         krb5_gss_register_acceptor_identity \
120         gss_krb5_ccache_name \
121      ])
122 dnl We only need gssapi for rxgk (at this point).  rxgk requires pseudo_random.
123      AS_IF([test x"$ac_cv_func_gss_pseudo_random" != xyes],
124            [BUILD_GSSAPI=no])
125      RRA_LIB_GSSAPI_RESTORE
126 ])
127 AC_SUBST([BUILD_GSSAPI])
128
129 dnl Checks for summary
130 OPENAFS_SUMMARY_CHECK_NAMEI
131
132 AS_IF([test -d 'doc/man-pages'],
133     [MAN_MAKEFILE="doc/man-pages/Makefile doc/man-pages/install-man"],
134     [MAN_MAKEFILE=])
135 AS_IF([test -f 'doc/xml/AdminGuide/Makefile.in'],
136     [ADMINGUIDE_MAKEFILE="doc/xml/AdminGuide/Makefile"],
137     [ADMINGUIDE_MAKEFILE=])
138 AS_IF([test -f 'doc/xml/QuickStartUnix/Makefile.in'],
139     [QSUNIX_MAKEFILE="doc/xml/QuickStartUnix/Makefile"],
140     [QSUNIX_MAKEFILE=])
141 AS_IF([test -f 'doc/xml/UserGuide/Makefile.in'],
142     [USERGUIDE_MAKEFILE="doc/xml/UserGuide/Makefile"],
143     [USERGUIDE_MAKEFILE=])
144 AS_IF([test -f 'doc/xml/AdminRef/Makefile.in'],
145     [ADMINREF_MAKEFILE="doc/xml/AdminRef/Makefile"],
146     [ADMINREF_MAKEFILE=])
147 AS_IF([test -f 'doc/xml/mobi-fixup.xsl.in'],
148     [MOBI_FIXUP_XSL="doc/xml/mobi-fixup.xsl"],
149     [MOBI_FIXUP_XSL=])
150 AS_IF([test -f 'doc/doxygen/Doxyfile.in'],
151     [DOXYFILE="doc/doxygen/Doxyfile"],
152     [DOXYFILE=])
153
154 AC_OUTPUT([
155     Makefile
156     ${MAN_MAKEFILE}
157     ${ADMINGUIDE_MAKEFILE}
158     ${QSUNIX_MAKEFILE}
159     ${USERGUIDE_MAKEFILE}
160     ${ADMINREF_MAKEFILE}
161     ${MOBI_FIXUP_XSL}
162     ${DOXYFILE}
163     src/afs/Makefile
164     src/afsd/Makefile
165     src/afsmonitor/Makefile
166     src/afsweb/Makefile
167     src/aklog/Makefile
168     src/audit/Makefile
169     src/auth/Makefile
170     src/auth/test/Makefile
171     src/bozo/Makefile
172     src/bozo/test/Makefile
173     src/bu_utils/Makefile
174     src/bubasics/Makefile
175     src/bucoord/Makefile
176     src/budb/Makefile
177     src/tbudb/Makefile
178     src/butc/Makefile
179     src/butm/Makefile
180     src/cmd/Makefile
181     src/cmd/test/Makefile
182     src/comerr/Makefile
183     src/comerr/test/Makefile
184     src/config/Makefile
185     src/config/Makefile.config
186     src/config/Makefile.libtool
187     src/config/Makefile.lwp
188     src/config/Makefile.lwptool
189     src/config/Makefile.pthread
190     src/config/Makefile.shared
191     src/config/Makefile.version-CML
192     src/config/Makefile.version-NOCML
193     src/config/shlib-build
194     src/config/shlib-install
195     src/crypto/hcrypto/Makefile
196     src/crypto/rfc3961/Makefile
197     src/dir/Makefile
198     src/dir/test/Makefile
199     src/dviced/Makefile
200     src/dvolser/Makefile
201     src/export/Makefile
202     src/finale/Makefile
203     src/fsint/Makefile
204     src/fsprobe/Makefile
205     src/gtx/Makefile
206     src/JAVA/libjafs/Makefile
207     src/kauth/Makefile
208     src/kauth/test/Makefile
209     src/kopenafs/Makefile
210     src/libacl/Makefile
211     src/libacl/test/Makefile
212     src/libadmin/Makefile
213     src/libadmin/adminutil/Makefile
214     src/libadmin/bos/Makefile
215     src/libadmin/cfg/Makefile
216     src/libadmin/cfg/test/Makefile
217     src/libadmin/client/Makefile
218     src/libadmin/kas/Makefile
219     src/libadmin/pts/Makefile
220     src/libadmin/samples/Makefile
221     src/libadmin/test/Makefile
222     src/libadmin/vos/Makefile
223     src/libafs/Makefile.common
224     src/libafs/MakefileProto.${MKAFS_OSTYPE}
225     ${DARWIN_PLIST}
226     src/libafsauthent/Makefile
227     src/libafsrpc/Makefile
228     src/libuafs/Makefile.common
229     src/libuafs/MakefileProto.${MKAFS_OSTYPE}
230     src/log/Makefile
231     src/log/test/Makefile
232     src/lwp/Makefile
233     src/lwp/test/Makefile
234     src/opr/Makefile
235     src/packaging/Debian/changelog
236     src/packaging/MacOS/OpenAFS-debug.Description.plist
237     src/packaging/MacOS/OpenAFS-debug.Info.plist
238     src/packaging/MacOS/OpenAFS.Description.plist
239     src/packaging/MacOS/OpenAFS.Info.plist
240     src/packaging/MacOS/OpenAFS.info
241     src/packaging/MacOS/buildpkg.sh
242     src/pam/Makefile
243     src/platform/Makefile
244     src/platform/${MKAFS_OSTYPE}/Makefile
245     src/platform/DARWIN/growlagent/Makefile
246     src/procmgmt/Makefile
247     src/procmgmt/test/Makefile
248     src/ptserver/Makefile
249     src/tptserver/Makefile
250     src/roken/Makefile
251     src/rx/Makefile
252     src/rx/bulk.example/Makefile
253     src/rx/bulktest/Makefile
254     src/rx/multi.example/Makefile
255     src/rx/simple.example/Makefile
256     src/rx/test/Makefile
257     src/rxdebug/Makefile
258     src/rxgen/Makefile
259     src/rxgk/Makefile
260     src/rxkad/Makefile
261     src/rxkad/test/Makefile
262     src/rxosd/Makefile
263     src/rxstat/Makefile
264     src/scout/Makefile
265     src/sgistuff/Makefile
266     src/sys/Makefile
267     src/tbutc/Makefile
268     src/tests/Makefile
269     src/tests/run-tests
270     src/tools/Makefile
271     src/tools/dumpscan/Makefile
272     src/tools/rxperf/Makefile
273     src/tsalvaged/Makefile
274     src/tsm41/Makefile
275     src/tvolser/Makefile
276     src/ubik/Makefile
277     src/tubik/Makefile
278     src/update/Makefile
279     src/usd/Makefile
280     src/usd/test/Makefile
281     src/uss/Makefile
282     src/util/Makefile
283     src/util/test/Makefile
284     src/libafscp/Makefile
285     src/venus/Makefile
286     src/venus/test/Makefile
287     src/vfsck/Makefile
288     src/viced/Makefile
289     src/vlserver/Makefile
290     src/tvlserver/Makefile
291     src/vol/Makefile
292     src/vol/test/Makefile
293     src/volser/Makefile
294     src/xstat/Makefile
295     src/helper-splint.sh
296     tests/Makefile
297     tests/auth/Makefile
298     tests/cmd/Makefile
299     tests/common/Makefile
300     tests/opr/Makefile
301     tests/rpctestlib/Makefile
302     tests/rx/Makefile
303     tests/tap/Makefile
304     tests/util/Makefile
305     tests/volser/Makefile],
306 [chmod a+x src/config/shlib-build
307  chmod a+x src/config/shlib-install])
308
309 # print a final summary
310 OPENAFS_SUMMARY