Build: Rework git version detection
[openafs.git] / configure.in
1 AC_PREREQ([2.60])
2 AC_INIT([OpenAFS], m4_esyscmd([build-tools/git-version .]))
3 AC_CONFIG_SRCDIR([src/config/stds.h])
4 AM_INIT_AUTOMAKE
5
6 AC_CONFIG_HEADER(src/config/afsconfig.h)
7 MACOS_VERSION=1.5.74f1
8 LINUX_PKGVER=1.5.74.1
9 #LINUX_PKGREL=0.pre3
10 LINUX_PKGREL=1.1
11
12 dnl Debian wants the release candidate version in the main upstream version,
13 dnl and wants ~ before it.
14 if echo "$LINUX_PKGREL" | grep pre >/dev/null 2>/dev/null ; then
15     DEB_PKGVER="$LINUX_PKGVER"`echo "$LINUX_PKGREL" | sed 's/0.pre/~rc/'`
16 else
17     DEB_PKGVER="$LINUX_PKGVER"
18 fi
19
20 AC_SUBST(MACOS_VERSION)
21 AC_SUBST(LINUX_PKGVER)
22 AC_SUBST(LINUX_PKGREL)
23 AC_SUBST(DEB_PKGVER)
24
25 AC_USE_SYSTEM_EXTENSIONS
26 AC_PROG_CC
27 AC_PATH_PROGS([PATH_CPP], [cpp], [${CC-cc} -E], [$PATH:/lib:/usr/ccs/lib])
28 AC_SUBST([PATH_CPP])
29 OPENAFS_CONFIGURE_COMMON
30
31 dnl Probe for Kerberos.  We have a few platform-specific overrides due to
32 dnl weird Kerberos implementations and installation locations.
33 AS_CASE([$AFS_SYSNAME],
34     [*_obsd*],
35     [KRB5_CPPFLAGS="-I/usr/include/kerberosV"],
36
37     [ppc_darwin_70],
38     [KRB5_CPPFLAGS="-I/usr/include"
39      KRB5_LDFLAGS="-L/usr/lib -Wl,-search_paths_first"])
40 RRA_LIB_KRB5_OPTIONAL
41 AS_CASE([$AFS_SYSNAME],
42     [hp_ux*|*_hpux*],
43     [KRB5_LIBS="-l:libkrb5.sl -l:libcom_err.sl"])
44
45 dnl Check for the characteristics of whatever Kerberos we found, if we found
46 dnl one.
47 BUILD_KRB5=no
48 MAKE_KRB5="#"
49 AS_IF([test x"$KRB5_LIBS" != x],
50     [BUILD_KRB5=yes
51      MAKE_KRB5=
52      RRA_LIB_KRB5_SWITCH
53      AC_CHECK_FUNCS([add_error_table \
54         add_to_error_table \
55         encode_krb5_enc_tkt_part \
56         encode_krb5_ticket \
57         krb5_allow_weak_crypto \
58         krb5_c_encrypt \
59         krb5_decode_ticket \
60         krb5_enctype_enable \
61         krb5_get_init_creds_opt_alloc \
62         krb5_get_prompt_types \
63         krb5_princ_size \
64         krb5_principal_get_comp_string])
65      AC_CHECK_FUNCS([krb5_524_convert_creds], ,
66          [AC_CHECK_FUNCS([krb524_convert_creds_kdc], ,
67              [AC_CHECK_LIB([krb524], [krb524_convert_creds_kdc],
68                  [LIBS="-lkrb524 $LIBS"
69                   KRB5_LIBS="-lkrb524 $KRB5_LIBS"
70                   AC_DEFINE([HAVE_KRB524_CONVERT_CREDS_KDC], 1,
71                      [Define to 1 if you have the `krb524_convert_creds_kdc' function.])])])])
72      AC_CHECK_HEADERS([kerberosIV/krb.h])
73      AC_CHECK_HEADERS([kerberosV/heim_err.h])
74      AC_CHECK_MEMBERS([krb5_creds.keyblock, krb5_creds.session,
75                        krb5_prompt.type], , , [#include <krb5.h>])
76      RRA_LIB_KRB5_RESTORE])
77 AC_SUBST([BUILD_KRB5])
78 AC_SUBST([MAKE_KRB5])
79
80 if test -d 'doc/man-pages' ; then
81     MAN_MAKEFILE="doc/man-pages/Makefile doc/man-pages/install-man"
82 else
83     MAN_MAKEFILE=
84 fi
85 if test -f 'doc/xml/AdminGuide/Makefile.in' ; then
86    ADMINGUIDE_MAKEFILE="doc/xml/AdminGuide/Makefile"
87 else
88    ADMINGUIDE_MAKEFILE=
89 fi
90 if test -f 'doc/xml/QuickStartUnix/Makefile.in' ; then
91    QSUNIX_MAKEFILE="doc/xml/QuickStartUnix/Makefile"
92 else
93    QSUNIX_MAKEFILE=
94 fi
95 if test -f 'doc/xml/UserGuide/Makefile.in' ; then
96    USERGUIDE_MAKEFILE="doc/xml/UserGuide/Makefile"
97 else
98    USERGUIDE_MAKEFILE=
99 fi
100
101 AC_OUTPUT(             \
102 Makefile               \
103 ${MAN_MAKEFILE} \
104 ${ADMINGUIDE_MAKEFILE} \
105 ${QSUNIX_MAKEFILE} \
106 ${USERGUIDE_MAKEFILE} \
107 src/afs/Makefile \
108 src/afsd/Makefile \
109 src/afsmonitor/Makefile \
110 src/afsweb/Makefile \
111 src/aklog/Makefile \
112 src/audit/Makefile \
113 src/auth/Makefile \
114 src/auth/test/Makefile \
115 src/bozo/Makefile \
116 src/bozo/test/Makefile \
117 src/bu_utils/Makefile \
118 src/bubasics/Makefile \
119 src/bucoord/Makefile \
120 src/budb/Makefile \
121 src/tbudb/Makefile \
122 src/butc/Makefile \
123 src/butm/Makefile \
124 src/cmd/Makefile \
125 src/cmd/test/Makefile \
126 src/comerr/Makefile \
127 src/comerr/test/Makefile \
128 src/config/Makefile \
129 src/config/Makefile.config \
130 src/config/Makefile.version-CML \
131 src/config/Makefile.version-NOCML \
132 src/config/shlib-build \
133 src/config/shlib-install \
134 src/des/Makefile \
135 src/des/test/Makefile \
136 src/dir/Makefile \
137 src/dir/test/Makefile \
138 src/export/Makefile \
139 src/finale/Makefile \
140 src/fsint/Makefile \
141 src/fsprobe/Makefile \
142 src/gtx/Makefile \
143 src/JAVA/libjafs/Makefile \
144 src/kauth/Makefile \
145 src/kauth/test/Makefile \
146 src/kopenafs/Makefile \
147 src/libacl/Makefile \
148 src/libacl/test/Makefile \
149 src/libadmin/Makefile \
150 src/libadmin/adminutil/Makefile \
151 src/libadmin/bos/Makefile \
152 src/libadmin/cfg/Makefile \
153 src/libadmin/cfg/test/Makefile \
154 src/libadmin/client/Makefile \
155 src/libadmin/kas/Makefile \
156 src/libadmin/pts/Makefile \
157 src/libadmin/samples/Makefile \
158 src/libadmin/test/Makefile \
159 src/libadmin/vos/Makefile \
160 src/libafs/Makefile.common \
161 src/libafs/MakefileProto.${MKAFS_OSTYPE} \
162 ${DARWIN_PLIST} \
163 src/libafsauthent/Makefile \
164 src/libafsrpc/Makefile \
165 src/libuafs/Makefile.common \
166 src/libuafs/MakefileProto.${MKAFS_OSTYPE} \
167 src/log/Makefile \
168 src/log/test/Makefile \
169 src/lwp/Makefile \
170 src/lwp/test/Makefile \
171 src/packaging/Debian/changelog \
172 src/packaging/MacOS/OpenAFS-debug.Description.plist \
173 src/packaging/MacOS/OpenAFS-debug.Info.plist \
174 src/packaging/MacOS/OpenAFS.Description.plist \
175 src/packaging/MacOS/OpenAFS.Info.plist \
176 src/packaging/MacOS/OpenAFS.info \
177 src/packaging/MacOS/buildpkg.sh \
178 src/packaging/RedHat/openafs.spec \
179 src/pam/Makefile \
180 src/platform/Makefile \
181 src/platform/${MKAFS_OSTYPE}/Makefile \
182 src/platform/DARWIN/growlagent/Makefile \
183 src/procmgmt/Makefile \
184 src/procmgmt/test/Makefile \
185 src/ptserver/Makefile \
186 src/tptserver/Makefile \
187 src/rx/Makefile \
188 src/rx/bulk.example/Makefile \
189 src/rx/bulktest/Makefile \
190 src/rx/multi.example/Makefile \
191 src/rx/simple.example/Makefile \
192 src/rx/test/Makefile \
193 src/rxdebug/Makefile \
194 src/rxgen/Makefile \
195 src/rxkad/Makefile \
196 src/rxkad/test/Makefile \
197 src/rxstat/Makefile \
198 src/scout/Makefile \
199 src/sgistuff/Makefile \
200 src/shlibafsauthent/Makefile \
201 src/shlibafsrpc/Makefile \
202 src/sys/Makefile \
203 src/tbutc/Makefile \
204 src/tests/Makefile \
205 src/tests/run-tests \
206 src/tsalvaged/Makefile \
207 src/tsm41/Makefile \
208 src/tviced/Makefile \
209 src/tvolser/Makefile \
210 src/ubik/Makefile \
211 src/tubik/Makefile \
212 src/update/Makefile \
213 src/usd/Makefile \
214 src/usd/test/Makefile \
215 src/uss/Makefile \
216 src/util/Makefile \
217 src/util/test/Makefile \
218 src/venus/Makefile \
219 src/venus/test/Makefile \
220 src/vfsck/Makefile \
221 src/viced/Makefile \
222 src/vlserver/Makefile \
223 src/tvlserver/Makefile \
224 src/vol/Makefile \
225 src/vol/test/Makefile \
226 src/volser/Makefile \
227 src/xstat/Makefile \
228 src/helper-splint.sh \
229 tests/Makefile \
230 tests/tap/Makefile \
231 tests/util/Makefile,
232
233 [chmod a+x src/config/shlib-build
234  chmod a+x src/config/shlib-install])