build-sys: use AS_IF instead of shell if clause
[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                   AC_DEFINE([HAVE_KRB524_CONVERT_CREDS_KDC], 1,
83                      [Define to 1 if you have the `krb524_convert_creds_kdc' function.])])])])
84      AC_CHECK_HEADERS([kerberosIV/krb.h])
85      AC_CHECK_HEADERS([kerberosV/heim_err.h])
86      AC_CHECK_MEMBERS([krb5_creds.keyblock, krb5_creds.keyblock.enctype, krb5_creds.session,
87                        krb5_prompt.type], [], [], [#include <krb5.h>])
88 dnl If we have krb5_creds.session, we are using heimdal
89 dnl If we're using heimdal, aklog needs libasn1 for encode_EncTicketPart and a
90 dnl few other functions. But just aklog; not any of the other stuff that uses
91 dnl krb5.
92      AS_IF([test x"$ac_cv_member_krb5_creds_session" = xyes],
93            [AC_CHECK_LIB([asn1], [encode_EncTicketPart],
94                         [AKLOG_KRB5_LIBS="-lasn1"])])
95      RRA_LIB_KRB5_RESTORE])
96 AC_SUBST([BUILD_KRB5])
97 AC_SUBST([MAKE_KRB5])
98 AC_SUBST([AKLOG_KRB5_LIBS])
99
100 dnl Probe for GSSAPI
101 RRA_LIB_GSSAPI
102
103 AS_IF([test -d 'doc/man-pages'],
104     [MAN_MAKEFILE="doc/man-pages/Makefile doc/man-pages/install-man"],
105     [MAN_MAKEFILE=])
106 AS_IF([test -f 'doc/xml/AdminGuide/Makefile.in'],
107     [ADMINGUIDE_MAKEFILE="doc/xml/AdminGuide/Makefile"],
108     [ADMINGUIDE_MAKEFILE=])
109 AS_IF([test -f 'doc/xml/QuickStartUnix/Makefile.in'],
110     [QSUNIX_MAKEFILE="doc/xml/QuickStartUnix/Makefile"],
111     [QSUNIX_MAKEFILE=])
112 AS_IF([test -f 'doc/xml/UserGuide/Makefile.in'],
113     [USERGUIDE_MAKEFILE="doc/xml/UserGuide/Makefile"],
114     [USERGUIDE_MAKEFILE=])
115 AS_IF([test -f 'doc/xml/AdminRef/Makefile.in'],
116     [ADMINREF_MAKEFILE="doc/xml/AdminRef/Makefile"],
117     [ADMINREF_MAKEFILE=])
118 AS_IF([test -f 'doc/xml/mobi-fixup.xsl.in'],
119     [MOBI_FIXUP_XSL="doc/xml/mobi-fixup.xsl"],
120     [MOBI_FIXUP_XSL=])
121
122 AC_OUTPUT([
123     Makefile
124     ${MAN_MAKEFILE}
125     ${ADMINGUIDE_MAKEFILE}
126     ${QSUNIX_MAKEFILE}
127     ${USERGUIDE_MAKEFILE}
128     ${ADMINREF_MAKEFILE}
129     ${MOBI_FIXUP_XSL}
130     src/afs/Makefile
131     src/afsd/Makefile
132     src/afsmonitor/Makefile
133     src/afsweb/Makefile
134     src/aklog/Makefile
135     src/audit/Makefile
136     src/auth/Makefile
137     src/auth/test/Makefile
138     src/bozo/Makefile
139     src/bozo/test/Makefile
140     src/bu_utils/Makefile
141     src/bubasics/Makefile
142     src/bucoord/Makefile
143     src/budb/Makefile
144     src/tbudb/Makefile
145     src/butc/Makefile
146     src/butm/Makefile
147     src/cmd/Makefile
148     src/cmd/test/Makefile
149     src/comerr/Makefile
150     src/comerr/test/Makefile
151     src/config/Makefile
152     src/config/Makefile.config
153     src/config/Makefile.libtool
154     src/config/Makefile.lwp
155     src/config/Makefile.lwptool
156     src/config/Makefile.pthread
157     src/config/Makefile.shared
158     src/config/Makefile.version-CML
159     src/config/Makefile.version-NOCML
160     src/config/shlib-build
161     src/config/shlib-install
162     src/crypto/hcrypto/Makefile
163     src/crypto/rfc3961/Makefile
164     src/dir/Makefile
165     src/dir/test/Makefile
166     src/dviced/Makefile
167     src/dvolser/Makefile
168     src/export/Makefile
169     src/finale/Makefile
170     src/fsint/Makefile
171     src/fsprobe/Makefile
172     src/gtx/Makefile
173     src/JAVA/libjafs/Makefile
174     src/kauth/Makefile
175     src/kauth/test/Makefile
176     src/kopenafs/Makefile
177     src/libacl/Makefile
178     src/libacl/test/Makefile
179     src/libadmin/Makefile
180     src/libadmin/adminutil/Makefile
181     src/libadmin/bos/Makefile
182     src/libadmin/cfg/Makefile
183     src/libadmin/cfg/test/Makefile
184     src/libadmin/client/Makefile
185     src/libadmin/kas/Makefile
186     src/libadmin/pts/Makefile
187     src/libadmin/samples/Makefile
188     src/libadmin/test/Makefile
189     src/libadmin/vos/Makefile
190     src/libafs/Makefile.common
191     src/libafs/MakefileProto.${MKAFS_OSTYPE}
192     ${DARWIN_PLIST}
193     src/libafsauthent/Makefile
194     src/libafsrpc/Makefile
195     src/libuafs/Makefile.common
196     src/libuafs/MakefileProto.${MKAFS_OSTYPE}
197     src/log/Makefile
198     src/log/test/Makefile
199     src/lwp/Makefile
200     src/lwp/test/Makefile
201     src/opr/Makefile
202     src/packaging/Debian/changelog
203     src/packaging/MacOS/OpenAFS-debug.Description.plist
204     src/packaging/MacOS/OpenAFS-debug.Info.plist
205     src/packaging/MacOS/OpenAFS.Description.plist
206     src/packaging/MacOS/OpenAFS.Info.plist
207     src/packaging/MacOS/OpenAFS.info
208     src/packaging/MacOS/buildpkg.sh
209     src/pam/Makefile
210     src/platform/Makefile
211     src/platform/${MKAFS_OSTYPE}/Makefile
212     src/platform/DARWIN/growlagent/Makefile
213     src/procmgmt/Makefile
214     src/procmgmt/test/Makefile
215     src/ptserver/Makefile
216     src/tptserver/Makefile
217     src/roken/Makefile
218     src/rx/Makefile
219     src/rx/bulk.example/Makefile
220     src/rx/bulktest/Makefile
221     src/rx/multi.example/Makefile
222     src/rx/simple.example/Makefile
223     src/rx/test/Makefile
224     src/rxdebug/Makefile
225     src/rxgen/Makefile
226     src/rxkad/Makefile
227     src/rxkad/test/Makefile
228     src/rxosd/Makefile
229     src/rxstat/Makefile
230     src/scout/Makefile
231     src/sgistuff/Makefile
232     src/sys/Makefile
233     src/tbutc/Makefile
234     src/tests/Makefile
235     src/tests/run-tests
236     src/tools/Makefile
237     src/tools/dumpscan/Makefile
238     src/tools/rxperf/Makefile
239     src/tsalvaged/Makefile
240     src/tsm41/Makefile
241     src/tvolser/Makefile
242     src/ubik/Makefile
243     src/tubik/Makefile
244     src/update/Makefile
245     src/usd/Makefile
246     src/usd/test/Makefile
247     src/uss/Makefile
248     src/util/Makefile
249     src/util/test/Makefile
250     src/libafscp/Makefile
251     src/venus/Makefile
252     src/venus/test/Makefile
253     src/vfsck/Makefile
254     src/viced/Makefile
255     src/vlserver/Makefile
256     src/tvlserver/Makefile
257     src/vol/Makefile
258     src/vol/test/Makefile
259     src/volser/Makefile
260     src/xstat/Makefile
261     src/helper-splint.sh
262     tests/Makefile
263     tests/auth/Makefile
264     tests/cmd/Makefile
265     tests/common/Makefile
266     tests/opr/Makefile
267     tests/rpctestlib/Makefile
268     tests/rx/Makefile
269     tests/tap/Makefile
270     tests/util/Makefile
271     tests/volser/Makefile],
272 [chmod a+x src/config/shlib-build
273  chmod a+x src/config/shlib-install])
274
275 # print a final summary
276 SUMMARY