]>
Commit | Line | Data |
---|---|---|
ea0caf4a | 1 | AC_INIT(patchlevel.h) |
2 | ||
3 | dnl On Athena at least, many of the packages (krb, zephyr, hesiod, etc) | |
4 | dnl will all be in /usr/athena... this hack lets us not end up with 10 | |
5 | dnl copies of -I/usr/athena/include -L/usr/athena/lib in our command lines | |
6 | AC_DEFUN(MR_EXTEND, [ | |
7 | case $$1 in | |
8 | *$2*) ;; | |
9 | *) $1=$2\ $$1 ;; | |
10 | esac | |
11 | ]) | |
12 | ||
13 | dnl Define for both C and Pro*C | |
14 | AC_DEFUN(MR_DEFINE, [ | |
15 | AC_DEFINE($1) | |
16 | MR_EXTEND(PRO_C_DEFS, DEFINE=$1) | |
17 | ]) | |
18 | ||
19 | dnl Add to include path for both C and Pro*C | |
20 | AC_DEFUN(MR_INCLUDE, [ | |
21 | MR_EXTEND(CPPFLAGS, -I$1) | |
22 | MR_EXTEND(PRO_C_INCLUDES, INCLUDE=$1) | |
23 | ]) | |
24 | ||
25 | dnl Add to lib path | |
26 | AC_DEFUN(MR_LIBS, [MR_EXTEND(LIBPATH, -L$1)]) | |
27 | ||
28 | AC_PROG_CC | |
29 | AC_PROG_INSTALL | |
30 | AC_PROG_RANLIB | |
31 | AC_PROG_MAKE_SET | |
32 | ||
33 | if test "$athena" = true; then | |
34 | enable_athena=yes | |
35 | with_readline=/mit/gnu | |
25f58600 | 36 | unset with_com_err |
ea0caf4a | 37 | prefix=/afs/athena.mit.edu/system/moira |
38 | bindir=$prefix/arch/$ATHENA_SYS/bin | |
39 | sbindir=$bindir | |
40 | fi | |
41 | ||
42 | # We currently just don't support changing this | |
43 | mrbindir=/moira/bin | |
44 | AC_SUBST(mrbindir) | |
45 | ||
46 | # Athena-local policy decisions | |
47 | AC_MSG_CHECKING(for Athena) | |
48 | AC_ARG_ENABLE(athena, | |
49 | [ --enable-athena Enable Athena-specific policy decisions], | |
50 | , [if test "$athena" = true; then | |
51 | enableval=yes | |
52 | else | |
53 | enableval=no | |
54 | fi]) | |
55 | AC_MSG_RESULT($enableval) | |
56 | if test "$enableval" = yes; then | |
57 | MR_DEFINE(ATHENA) | |
58 | fi | |
59 | ||
60 | # Networking libraries | |
61 | AC_CHECKING(network libraries...) | |
62 | AC_CHECK_FUNC(gethostbyname, :, | |
63 | AC_CHECK_LIB(nsl, gethostbyname, , | |
64 | AC_CHECK_LIB(resolv, gethostbyname))) | |
65 | AC_CHECK_FUNC(socket, :, | |
66 | AC_CHECK_LIB(socket, socket, , | |
67 | AC_CHECK_LIB(socket, socket, | |
68 | LIBS="-lsocket -lnsl $LIBS", :, | |
69 | -lnsl))) | |
70 | ||
7f7f279f | 71 | # com_err (required, but can be built) |
72 | AC_MSG_CHECKING(for com_err) | |
73 | AC_ARG_WITH(com_err, | |
74 | [ --with-com_err=PREFIX Specify location of com_err], | |
75 | [AC_MSG_RESULT($withval) | |
76 | if test $withval = "no"; then | |
77 | AC_MSG_ERROR(com_err is required for Moira) | |
78 | fi | |
79 | if test $withval != "yes"; then | |
80 | MR_INCLUDE($withval/include) | |
81 | MR_LIBS($withval/lib) | |
82 | fi | |
83 | COMPILE_ET=compile_et], | |
84 | [AC_MSG_RESULT(util/et) | |
85 | COM_ERR_SUBDIR=util/et; | |
86 | MR_INCLUDE(`pwd`/util/et) | |
87 | MR_LIBS(`pwd`/util/et) | |
88 | COMPILE_ET=`pwd`/util/et/compile_et | |
89 | AC_CONFIG_SUBDIRS($COM_ERR_SUBDIR)]) | |
90 | AC_SUBST(COM_ERR_SUBDIR) | |
91 | AC_SUBST(COMPILE_ET) | |
92 | ||
93 | # Kerberos (Kerberos 4 required, Kerberos 5 optional for reg_svr) | |
ea0caf4a | 94 | AC_MSG_CHECKING(for Kerberos 4) |
95 | AC_ARG_WITH(krb4, | |
96 | [ --with-krb4=PREFIX Specify location of krb4], | |
97 | [krb4="$withval"], [krb4=no]) | |
98 | AC_MSG_RESULT($krb4) | |
99 | if test $krb4 = "no"; then | |
100 | AC_MSG_ERROR(Kerberos is required for Moira) | |
101 | fi | |
102 | if test "$krb4" != yes; then | |
103 | MR_INCLUDE($krb4/include) | |
104 | if test -d "$krb4/include/kerberosIV"; then | |
105 | MR_INCLUDE($krb4/include/kerberosIV) | |
106 | fi | |
107 | MR_LIBS($krb4/lib) | |
108 | elif test -d /usr/include/kerberosIV; then | |
109 | MR_INCLUDE(/usr/include/kerberosIV) | |
110 | fi | |
111 | AC_CHECK_LIB(krb4, krb_rd_req, | |
112 | [KRB4_LIBS="-lkrb4 -ldes425 -lkrb5 -lcrypto"], | |
113 | [AC_CHECK_LIB(krb, krb_rd_req, | |
114 | [KRB4_LIBS="-lkrb -ldes"], | |
115 | [AC_MSG_ERROR(Kerberos 4 libraries not found)], | |
116 | $LIBPATH -ldes)], | |
7f7f279f | 117 | $LIBPATH -ldes425 -lkrb5 -lcrypto -lcom_err) |
ea0caf4a | 118 | |
7f7f279f | 119 | AC_MSG_CHECKING(for Kerberos 5) |
120 | AC_ARG_WITH(krb5, | |
121 | [ --with-krb5=PREFIX Specify location of krb5 (for reg_svr)], | |
122 | [krb5="$withval"], [krb5=no]) | |
123 | AC_MSG_RESULT($krb5) | |
124 | if test "$krb5" != no; then | |
125 | REG_SVR_DEFS=-DKRB5 | |
126 | if test "$krb5" != yes; then | |
127 | REG_SVR_INCLUDES=-I$krb5/include | |
128 | REG_SVR_LIBS=-L$krb5/lib | |
129 | fi | |
130 | REG_SVR_LIBS="$REG_SVR_LIBS -lkadm5clnt -lgssapi_krb5 -lgssrpc -ldyn -lkrb4 -ldes425 -lkrb5 -lcrypto" | |
131 | else | |
132 | REG_SVR_DEFS=-DKRB4 | |
133 | REG_SVR_LIBS=-lkadm | |
134 | fi | |
135 | AC_SUBST(REG_SVR_DEFS) | |
136 | AC_SUBST(REG_SVR_INCLUDES) | |
137 | AC_SUBST(REG_SVR_LIBS) | |
33567bea | 138 | |
ea0caf4a | 139 | # Hesiod support |
140 | AC_MSG_CHECKING(for Hesiod) | |
141 | AC_ARG_WITH(hesiod, | |
142 | [ --with-hesiod=PREFIX Specify location of Hesiod], | |
143 | [hesiod="$withval"], [hesiod=no]) | |
144 | AC_MSG_RESULT($hesiod) | |
145 | if test "$hesiod" != no; then | |
146 | if test "$hesiod" != yes; then | |
147 | MR_INCLUDE($hesiod/include) | |
148 | MR_LIBS($hesiod/lib) | |
149 | fi | |
150 | AC_CHECK_FUNC(res_send, :, | |
151 | AC_CHECK_LIB(resolv, res_send)) | |
152 | AC_CHECK_LIB(hesiod, hes_resolve, :, | |
153 | [AC_MSG_ERROR(Hesiod library not found)], | |
154 | $LIBPATH $LIBS) | |
155 | MR_DEFINE(HAVE_HESIOD) | |
156 | fi | |
157 | ||
158 | # Zephyr support | |
159 | AC_MSG_CHECKING(for Zephyr) | |
160 | AC_ARG_WITH(zephyr, | |
161 | [ --with-zephyr=PREFIX Specify location of Zephyr], | |
162 | [zephyr="$withval"], [zephyr=no]) | |
163 | AC_MSG_RESULT($zephyr) | |
164 | if test "$zephyr" != no; then | |
165 | if test "$zephyr" != yes; then | |
166 | MR_INCLUDE($zephyr/include) | |
167 | MR_LIBS($zephyr/lib) | |
168 | fi | |
169 | AC_CHECK_LIB(zephyr, ZInitialize, :, | |
170 | [AC_MSG_ERROR(Zephyr library not found)], | |
171 | $LIBPATH $KRB4_LIBS -lcom_err) | |
172 | MR_DEFINE(HAVE_ZEPHYR) | |
173 | fi | |
174 | ||
175 | # GDSS support (default: build util/gdss if present) | |
176 | AC_MSG_CHECKING(for GDSS) | |
177 | AC_ARG_WITH(gdss, | |
178 | [ --with-gdss=PREFIX Specify location of GDSS], | |
179 | [gdss="$withval" | |
cd357ef5 | 180 | MR_INCLUDE("$gdss/include") |
ea0caf4a | 181 | GDSS_LIBS="-L$gdss/lib -lgdss"], |
182 | [if test -d $srcdir/util/gdss; then | |
183 | gdss=$srcdir/util/gdss | |
184 | GDSS_SUBDIR=util/gdss | |
185 | GDSS_OUTPUT_FILES="util/gdss/Makefile util/gdss/lib/Makefile \ | |
186 | util/gdss/lib/crypto/Makefile util/gdss/lib/crypto/bignum/Makefile \ | |
187 | util/gdss/lib/crypto/algorithm/Makefile" | |
188 | # autoconf can't deal with creating util/gdss if util doesn't exist | |
189 | if test ! -d util; then | |
190 | mkdir util | |
191 | fi | |
cd357ef5 | 192 | MR_INCLUDE('$(SRCTOP)/util/gdss/include') |
ea0caf4a | 193 | GDSS_LIBS='-L$(BUILDTOP)/util/gdss/lib -lgdss' |
3fb6166b | 194 | GDSS_LIBDEP='$(BUILDTOP)/util/gdss/lib/libgdss.a' |
ea0caf4a | 195 | else |
196 | gdss=no | |
197 | fi]) | |
198 | AC_MSG_RESULT($gdss) | |
199 | if test "$gdss" != no; then | |
200 | GDSS_OBJS='$(GDSS_OBJS)' | |
201 | GDSS_CFILES='$(GDSS_CFILES)' | |
202 | GDSS_TARGET='$(GDSS_TARGET)' | |
203 | MR_DEFINE(HAVE_GDSS) | |
204 | fi | |
205 | AC_SUBST(GDSS_CPPFLAGS) | |
206 | AC_SUBST(GDSS_LIBS) | |
207 | AC_SUBST(GDSS_SUBDIR) | |
208 | AC_SUBST(GDSS_OBJS) | |
209 | AC_SUBST(GDSS_CFILES) | |
210 | AC_SUBST(GDSS_TARGET) | |
3fb6166b | 211 | AC_SUBST(GDSS_LIBDEP) |
ea0caf4a | 212 | |
33567bea | 213 | # RSAREF support (default: build util/rsaref if present) |
214 | AC_MSG_CHECKING(for RSAREF) | |
215 | AC_ARG_WITH(rsaref, | |
216 | [ --with-rsaref=PREFIX Specify location of RSAREF], | |
217 | [rsaref="$withval" | |
218 | RSAREF_CPPFLAGS="-I$rsaref/include" | |
219 | RSAREF_LIBS="$rsaref/lib/rsaref.a"], | |
220 | RSAREF_SUBDIRS=reg_svr | |
221 | [if test -d $srcdir/util/rsaref; then | |
222 | rsaref=$srcdir/util/rsaref | |
223 | RSAREF_SUBDIRS="util/rsaref reg_svr" | |
224 | RSAREF_OUTPUT_FILES="util/rsaref/Makefile" | |
225 | # autoconf can't deal with creating util/rsaref if util doesn't exist | |
226 | if test ! -d util; then | |
227 | mkdir util | |
228 | fi | |
46fa38eb | 229 | RSAREF_CPPFLAGS='-I$(SRCTOP)/util/rsaref' |
33567bea | 230 | RSAREF_LIBS='$(BUILDTOP)/util/rsaref/rsaref.a' |
3fb6166b | 231 | RSAREF_LIBDEP='$(BUILDTOP)/util/rsaref/rsaref.a' |
33567bea | 232 | else |
233 | rsaref=no | |
234 | fi]) | |
235 | AC_MSG_RESULT($rsaref) | |
236 | if test "$rsaref" != no; then | |
237 | MR_DEFINE(HAVE_RSAREF) | |
238 | fi | |
239 | AC_SUBST(RSAREF_CPPFLAGS) | |
240 | AC_SUBST(RSAREF_LIBS) | |
241 | AC_SUBST(RSAREF_SUBDIRS) | |
3fb6166b | 242 | AC_SUBST(RSAREF_LIBDEP) |
33567bea | 243 | |
ea0caf4a | 244 | # Oracle (default: yes, if $ORACLE_HOME is set) |
245 | AC_MSG_CHECKING(for Oracle) | |
246 | AC_ARG_WITH(oracle, | |
247 | [ --with-oracle=PREFIX Specify location of Oracle (for server)], | |
248 | [oracle="$withval"], | |
249 | [if test -n "$ORACLE_HOME" -a -d "$ORACLE_HOME"; then | |
250 | oracle=$ORACLE_HOME | |
251 | else | |
252 | oracle=no | |
253 | fi]) | |
254 | AC_MSG_RESULT($oracle) | |
255 | if test "$oracle" != no; then | |
cd357ef5 | 256 | AC_MSG_CHECKING(Pro*C version) |
257 | ORACLE_HOME=$oracle release=`$ORACLE_HOME/bin/proc | awk '/Release/ {print $3;}'` | |
258 | AC_MSG_RESULT($release) | |
259 | case $release in | |
260 | 2.0.6.0.0) | |
261 | SQL_LIBS="-L$oracle/lib -lsql $oracle/lib/osntab.o -lsqlnet -lora -lsqlnet -lnlsrtl -lcv6 -lcore -lnlsrtl -lcore -lm" | |
262 | ;; | |
263 | *) | |
264 | SQL_LIBS="-L$oracle/lib -lclntsh -lxa -lsql -lsqlnet -lncr -lsqlnet -lclient -lcommon -lgeneric -lsqlnet -lncr -lsqlnet -lclient -lcommon -lgeneric -lepc -lnlsrtl3 -lc3v6 -lcore3 -lnlsrtl3 -lcore3 -lnlsrtl3 `cat $oracle/rdbms/lib/sysliblist` -lm -lthread" | |
265 | ;; | |
266 | esac | |
ea0caf4a | 267 | SVRSUBDIRS='$(SVRDIRS)' |
9ed720ef | 268 | SERVER_OUTPUT_FILES="db/Makefile server/Makefile backup/Makefile dbck/Makefile dcm/Makefile gen/Makefile reg_svr/Makefile regtape/Makefile" |
ea0caf4a | 269 | PRO_C=$oracle/bin/proc |
270 | PRO_C_OPTS=CODE=ANSI_C | |
cd357ef5 | 271 | PRO_C_DEFS="DEFINE=_PROC_ $PRO_C_DEFS" |
ea0caf4a | 272 | fi |
273 | AC_SUBST(PRO_C) | |
274 | AC_SUBST(PRO_C_DEFS) | |
275 | AC_SUBST(PRO_C_INCLUDES) | |
276 | AC_SUBST(PRO_C_OPTS) | |
277 | AC_SUBST(SQL_LIBS) | |
278 | AC_SUBST(SVRSUBDIRS) | |
279 | ||
280 | # AFS support | |
281 | AC_MSG_CHECKING(for AFS) | |
282 | AC_ARG_WITH(afs, | |
283 | [ --with-afs=PREFIX Specify location of AFS libs (for server)], | |
284 | [afs="$withval"], [afs=no]) | |
285 | AC_MSG_RESULT($afs) | |
286 | if test "$afs" != no -a "$oracle" != no; then | |
287 | if test "$afs" != yes; then | |
288 | AFS_CPPFLAGS="-I$afs/include -I$afs/include/afs -I$afs/include/rx" | |
289 | AFS_PRO_C_INCLUDES="INCLUDE=$afs/include INCLUDE=$afs/include/afs INCLUDE=$afs/include/rx" | |
290 | AFS_LIBS="-L$afs/lib -L$afs/lib/afs" | |
291 | AFS_DIR=$afs | |
292 | fi | |
293 | AC_CHECK_FUNC(insque, :, AC_CHECK_LIB(compat, insque, | |
294 | AFS_EXTRA_LIBS="-lcompat", | |
295 | AC_MSG_ERROR(insque not found))) | |
296 | AC_CHECK_FUNC(sigvec, :, AC_CHECK_LIB(ucb, sigvec, | |
297 | AFS_EXTRA_LIBS="$AFS_EXTRA_LIBS -L/usr/ucblib -lc -lucb", | |
298 | :, -L/usr/ucblib)) | |
299 | AC_CHECK_LIB(sys, pioctl, :, | |
300 | [AC_MSG_ERROR(AFS libraries not found)], | |
301 | $AFS_LIBS -lrx -llwp -lsys $AFS_EXTRA_LIBS) | |
302 | MR_DEFINE(HAVE_AFS) | |
9ed720ef | 303 | |
304 | AFS_SUBDIRS="incremental" | |
305 | AFS_OUTPUT_FILES="incremental/Makefile" | |
306 | if test -d $srcdir/afssync; then | |
307 | AFS_SUBDIRS="$AFS_SUBDIRS afssync" | |
308 | AFS_OUTPUT_FILES="$AFS_OUTPUT_FILES afssync/Makefile" | |
309 | fi | |
ea0caf4a | 310 | fi |
311 | AC_SUBST(AFS_CPPFLAGS) | |
312 | AC_SUBST(AFS_PRO_C_INCLUDES) | |
313 | AC_SUBST(AFS_LIBS) | |
314 | AC_SUBST(AFS_EXTRA_LIBS) | |
315 | AC_SUBST(AFS_DIR) | |
9ed720ef | 316 | AC_SUBST(AFS_SUBDIRS) |
ea0caf4a | 317 | |
318 | # GNU readline | |
319 | AC_CHECKING(for GNU readline...) | |
320 | AC_ARG_WITH(readline, | |
321 | [ --with-readline=PREFIX Specify location of GNU readline], | |
322 | [readline="$withval"], | |
323 | [AC_CHECK_LIB(readline, readline, [readline=yes], :, -ltermcap)]) | |
324 | if test "$readline" != no; then | |
325 | if test "$readline" != yes; then | |
c11ad1ff | 326 | READLINE_CPPFLAGS="-I$readline/include -I$readline/include/readline -DHAVE_READLINE" |
ea0caf4a | 327 | READLINE_LIBS="-L$readline/lib -lreadline -ltermcap" |
328 | fi | |
329 | fi | |
330 | AC_SUBST(READLINE_CPPFLAGS) | |
331 | AC_SUBST(READLINE_LIBS) | |
332 | ||
333 | # Curses | |
334 | curses=curses | |
335 | AC_CHECKING(for curses) | |
336 | AC_CHECK_LIB(curses, main, :, AC_CHECK_LIB(ncurses, main, curses=ncurses)) | |
337 | if test -n "$curses"; then | |
338 | OLDLIBS=$LIBS | |
339 | LIBS=-l$curses | |
340 | AC_CHECKING(if curses needs termcap) | |
341 | dnl we need to use AC_TRY_RUN because under NetBSD, the program will | |
342 | dnl link with just -lcurses, but then fail with a runtime linker error | |
343 | dnl because you didn't use -ltermcap | |
344 | AC_TRY_RUN([#include <curses.h> | |
345 | main(int argc, char **argv) | |
346 | { | |
347 | initscr(); | |
348 | endwin(); | |
349 | return 0; | |
350 | }], [CURSES_LIBS="-l$curses"], | |
351 | LIBS="-l$curses -ltermcap" | |
352 | AC_TRY_RUN([#include <curses.h> | |
353 | main(int argc, char **argv) | |
354 | { | |
355 | initscr(); | |
356 | endwin(); | |
357 | return 0; | |
358 | }], [CURSES_LIBS="-l$curses -ltermcap"], | |
359 | :, :), | |
360 | :) | |
361 | LIBS=$OLDLIBS | |
362 | fi | |
363 | if test -n "$CURSES_LIBS"; then | |
364 | OLDLIBS=$LIBS | |
365 | LIBS=$CURSES_LIBS | |
366 | AC_TRY_LINK([#include <curses.h>],[WINDOW *w; getmaxx(w);], | |
367 | :, | |
368 | AC_TRY_COMPILE([#include <curses.h>],[WINDOW *w; w->_maxx;], | |
369 | [CURSES_CPPFLAGS="-D'getmaxx(w)=w->_maxx'"], | |
370 | [CURSES_CPPFLAGS="-D'getmaxx(w)=w->maxx'"])) | |
371 | LIBS=$OLDLIBS | |
372 | CURSES_CPPFLAGS="-DHAVE_CURSES $CURSES_CPPFLAGS" | |
373 | CURSES_SUBDIRS='$(CURSES_SUBDIRS)' | |
374 | else | |
375 | AC_MSG_WARN(Couldn't find -lcurses) | |
376 | fi | |
377 | AC_SUBST(CURSES_CPPFLAGS) | |
378 | AC_SUBST(CURSES_LIBS) | |
379 | AC_SUBST(CURSES_SUBDIRS) | |
380 | ||
381 | ||
382 | AC_CHECK_FUNCS(getusershell) | |
383 | ||
25f58600 | 384 | MR_EXTEND(PRO_C_INCLUDES, INCLUDE='$(srcdir)') |
ea0caf4a | 385 | MR_INCLUDE('$(SRCTOP)/include') |
25f58600 | 386 | MR_INCLUDE('$(SRCTOP)/lib') |
ea0caf4a | 387 | MR_INCLUDE('$(BUILDTOP)/lib') |
388 | MR_INCLUDE('$(BUILDTOP)/db') | |
f4036eed | 389 | MR_INCLUDE('$(srcdir)') |
ea0caf4a | 390 | LDFLAGS="$LDFLAGS -L\$(BUILDTOP)/lib $LIBPATH" |
391 | KLIBS="-lzephyr $KRB4_LIBS -lcom_err -lhesiod $LIBS" | |
392 | LIBS="-lmoira $KLIBS" | |
393 | AC_SUBST(KLIBS) | |
394 | ||
3fb6166b | 395 | MR_LIBDEP='$(BUILDTOP)/lib/libmoira.a' |
396 | AC_SUBST(MR_LIBDEP) | |
397 | ||
ea0caf4a | 398 | AC_OUTPUT(Makefile lib/Makefile include/Makefile clients/Makefile \ |
399 | clients/addusr/Makefile clients/blanche/Makefile \ | |
400 | clients/mailmaint/Makefile clients/moira/Makefile \ | |
401 | clients/mrcheck/Makefile clients/mrtest/Makefile \ | |
1c1c45eb | 402 | clients/passwd/Makefile update/Makefile man/Makefile \ |
9ed720ef | 403 | $SERVER_OUTPUT_FILES $AFS_OUTPUT_FILES \ |
404 | $GDSS_OUTPUT_FILES $RSAREF_OUTPUT_FILES) |