]> andersk Git - moira.git/blame - configure.in
Add to list of things we skip.
[moira.git] / configure.in
CommitLineData
ea0caf4a 1AC_INIT(patchlevel.h)
2
3dnl On Athena at least, many of the packages (krb, zephyr, hesiod, etc)
4dnl will all be in /usr/athena... this hack lets us not end up with 10
5dnl copies of -I/usr/athena/include -L/usr/athena/lib in our command lines
6AC_DEFUN(MR_EXTEND, [
7 case $$1 in
8 *$2*) ;;
9 *) $1=$2\ $$1 ;;
10 esac
11])
12
3595c6c0 13AC_CANONICAL_HOST
0bec79fd 14# SO_LDFLAGS setting below is a great big ick.
15# But it beats sucking in libtool for one small part of the source tree.
3595c6c0 16case $host_os in
17solaris*)
18 short_os=solaris
0bec79fd 19 SO_LDFLAGS="-G"
3595c6c0 20 ;;
21irix*)
22 short_os=irix
0bec79fd 23 SO_LDFLAGS="-shared"
3595c6c0 24 ;;
25linux*)
26 short_os=linux
0bec79fd 27 SO_LDFLAGS="-shared"
3595c6c0 28 ;;
29esac
0bec79fd 30AC_SUBST(SO_LDFLAGS)
3595c6c0 31
ea0caf4a 32dnl Define for both C and Pro*C
33AC_DEFUN(MR_DEFINE, [
34 AC_DEFINE($1)
35 MR_EXTEND(PRO_C_DEFS, DEFINE=$1)
36])
37
38dnl Add to include path for both C and Pro*C
39AC_DEFUN(MR_INCLUDE, [
40 MR_EXTEND(CPPFLAGS, -I$1)
41 MR_EXTEND(PRO_C_INCLUDES, INCLUDE=$1)
42])
43
44dnl Add to lib path
45AC_DEFUN(MR_LIBS, [MR_EXTEND(LIBPATH, -L$1)])
46
47AC_PROG_CC
48AC_PROG_INSTALL
49AC_PROG_RANLIB
50AC_PROG_MAKE_SET
51
52if test "$athena" = true; then
53 enable_athena=yes
1944209a 54 prefix=/afs/.athena.mit.edu/system/moira
ea0caf4a 55 bindir=$prefix/arch/$ATHENA_SYS/bin
56 sbindir=$bindir
618b3834 57 MR_INCLUDE(/usr/athena/include)
618b3834 58 MR_LIBS(/usr/athena/lib)
ea0caf4a 59fi
60
61# We currently just don't support changing this
62mrbindir=/moira/bin
63AC_SUBST(mrbindir)
64
65# Athena-local policy decisions
66AC_MSG_CHECKING(for Athena)
67AC_ARG_ENABLE(athena,
68 [ --enable-athena Enable Athena-specific policy decisions],
69 , [if test "$athena" = true; then
70 enableval=yes
71 else
72 enableval=no
73 fi])
74AC_MSG_RESULT($enableval)
75if test "$enableval" = yes; then
76 MR_DEFINE(ATHENA)
77fi
78
79# Networking libraries
80AC_CHECKING(network libraries...)
81AC_CHECK_FUNC(gethostbyname, :,
82 AC_CHECK_LIB(nsl, gethostbyname, ,
83 AC_CHECK_LIB(resolv, gethostbyname)))
84AC_CHECK_FUNC(socket, :,
85 AC_CHECK_LIB(socket, socket, ,
86 AC_CHECK_LIB(socket, socket,
87 LIBS="-lsocket -lnsl $LIBS", :,
88 -lnsl)))
89
7f7f279f 90# com_err (required, but can be built)
91AC_MSG_CHECKING(for com_err)
92AC_ARG_WITH(com_err,
93 [ --with-com_err=PREFIX Specify location of com_err],
94 [AC_MSG_RESULT($withval)
95 if test $withval = "no"; then
96 AC_MSG_ERROR(com_err is required for Moira)
97 fi
98 if test $withval != "yes"; then
99 MR_INCLUDE($withval/include)
100 MR_LIBS($withval/lib)
101 fi
102 COMPILE_ET=compile_et],
103 [AC_MSG_RESULT(util/et)
7f7f279f 104 MR_INCLUDE(`pwd`/util/et)
105 MR_LIBS(`pwd`/util/et)
106 COMPILE_ET=`pwd`/util/et/compile_et
00274452 107 AC_CONFIG_SUBDIRS(util/et)])
7f7f279f 108AC_SUBST(COM_ERR_SUBDIR)
109AC_SUBST(COMPILE_ET)
110
cb974713 111AC_CHECK_LIB(k5crypto, main, crypto="k5crypto",
112 [AC_CHECK_LIB(crypto, main, crypto="crypto")])
113
114# Kerberos (Kerberos 4 optional, Kerberos 5 required)
ea0caf4a 115AC_MSG_CHECKING(for Kerberos 4)
116AC_ARG_WITH(krb4,
117 [ --with-krb4=PREFIX Specify location of krb4],
118 [krb4="$withval"], [krb4=no])
119AC_MSG_RESULT($krb4)
cb974713 120if test "$krb4" != no; then
121 if test "$krb4" != yes; then
122 MR_INCLUDE($krb4/include)
123 if test -d "$krb4/include/kerberosIV"; then
124 MR_INCLUDE($krb4/include/kerberosIV)
125 fi
126 MR_LIBS($krb4/lib)
127 elif test -d /usr/include/kerberosIV; then
128 MR_INCLUDE(/usr/include/kerberosIV)
ea0caf4a 129 fi
cb974713 130 MR_DEFINE(HAVE_KRB4)
131 AC_CHECK_LIB(krb4, krb_rd_req,
132 [KRB4_LIBS="-lkrb4 -ldes425 -lkrb5 -l${crypto} -lresolv"],
133 [AC_CHECK_LIB(krb, krb_rd_req,
134 [KRB4_LIBS="-lkrb -ldes"],
135 [AC_MSG_ERROR(Kerberos 4 libraries not found)],
136 $LIBPATH -ldes)],
137 $LIBPATH -ldes425 -lkrb5 -l${crypto} -lcom_err -lresolv)
ea0caf4a 138fi
ea0caf4a 139
7f7f279f 140AC_MSG_CHECKING(for Kerberos 5)
141AC_ARG_WITH(krb5,
cb974713 142 [ --with-krb5=PREFIX Specify location of krb5],
7f7f279f 143 [krb5="$withval"], [krb5=no])
144AC_MSG_RESULT($krb5)
145if test "$krb5" != no; then
146 REG_SVR_DEFS=-DKRB5
147 if test "$krb5" != yes; then
148 REG_SVR_INCLUDES=-I$krb5/include
149 REG_SVR_LIBS=-L$krb5/lib
cb974713 150 MR_INCLUDE($krb5/include)
151 MR_LIBS($krb5/lib)
7f7f279f 152 fi
cb974713 153 MR_DEFINE(HAVE_KRB5)
154 KRB5_LIBS="-lkrb5 -l${crypto} -lcom_err -lresolv"
155 REG_SVR_LIBS="$REG_SVR_LIBS -lkadm5clnt -lgssapi_krb5 -lgssrpc -lkrb5 -l${crypto} -lresolv"
7f7f279f 156else
157 REG_SVR_DEFS=-DKRB4
158 REG_SVR_LIBS=-lkadm
159fi
160AC_SUBST(REG_SVR_DEFS)
161AC_SUBST(REG_SVR_INCLUDES)
162AC_SUBST(REG_SVR_LIBS)
33567bea 163
ea0caf4a 164# Hesiod support
165AC_MSG_CHECKING(for Hesiod)
166AC_ARG_WITH(hesiod,
167 [ --with-hesiod=PREFIX Specify location of Hesiod],
168 [hesiod="$withval"], [hesiod=no])
169AC_MSG_RESULT($hesiod)
170if test "$hesiod" != no; then
171 if test "$hesiod" != yes; then
172 MR_INCLUDE($hesiod/include)
173 MR_LIBS($hesiod/lib)
174 fi
175 AC_CHECK_FUNC(res_send, :,
176 AC_CHECK_LIB(resolv, res_send))
177 AC_CHECK_LIB(hesiod, hes_resolve, :,
178 [AC_MSG_ERROR(Hesiod library not found)],
179 $LIBPATH $LIBS)
180 MR_DEFINE(HAVE_HESIOD)
181fi
182
183# Zephyr support
184AC_MSG_CHECKING(for Zephyr)
185AC_ARG_WITH(zephyr,
186 [ --with-zephyr=PREFIX Specify location of Zephyr],
187 [zephyr="$withval"], [zephyr=no])
188AC_MSG_RESULT($zephyr)
189if test "$zephyr" != no; then
190 if test "$zephyr" != yes; then
191 MR_INCLUDE($zephyr/include)
192 MR_LIBS($zephyr/lib)
193 fi
194 AC_CHECK_LIB(zephyr, ZInitialize, :,
195 [AC_MSG_ERROR(Zephyr library not found)],
cb974713 196 $LIBPATH $KRB4_LIBS $KRB5_LIBS -lcom_err)
ea0caf4a 197 MR_DEFINE(HAVE_ZEPHYR)
198fi
199
33567bea 200# RSAREF support (default: build util/rsaref if present)
201AC_MSG_CHECKING(for RSAREF)
202AC_ARG_WITH(rsaref,
203 [ --with-rsaref=PREFIX Specify location of RSAREF],
204 [rsaref="$withval"
205 RSAREF_CPPFLAGS="-I$rsaref/include"
206 RSAREF_LIBS="$rsaref/lib/rsaref.a"],
207 RSAREF_SUBDIRS=reg_svr
208 [if test -d $srcdir/util/rsaref; then
209 rsaref=$srcdir/util/rsaref
210 RSAREF_SUBDIRS="util/rsaref reg_svr"
211 RSAREF_OUTPUT_FILES="util/rsaref/Makefile"
212 # autoconf can't deal with creating util/rsaref if util doesn't exist
213 if test ! -d util; then
214 mkdir util
215 fi
46fa38eb 216 RSAREF_CPPFLAGS='-I$(SRCTOP)/util/rsaref'
33567bea 217 RSAREF_LIBS='$(BUILDTOP)/util/rsaref/rsaref.a'
3fb6166b 218 RSAREF_LIBDEP='$(BUILDTOP)/util/rsaref/rsaref.a'
33567bea 219 else
220 rsaref=no
221 fi])
222AC_MSG_RESULT($rsaref)
223if test "$rsaref" != no; then
224 MR_DEFINE(HAVE_RSAREF)
225fi
226AC_SUBST(RSAREF_CPPFLAGS)
227AC_SUBST(RSAREF_LIBS)
228AC_SUBST(RSAREF_SUBDIRS)
3fb6166b 229AC_SUBST(RSAREF_LIBDEP)
33567bea 230
ea0caf4a 231# Oracle (default: yes, if $ORACLE_HOME is set)
232AC_MSG_CHECKING(for Oracle)
233AC_ARG_WITH(oracle,
234 [ --with-oracle=PREFIX Specify location of Oracle (for server)],
235 [oracle="$withval"],
236 [if test -n "$ORACLE_HOME" -a -d "$ORACLE_HOME"; then
237 oracle=$ORACLE_HOME
238 else
239 oracle=no
240 fi])
241AC_MSG_RESULT($oracle)
242if test "$oracle" != no; then
cd357ef5 243 AC_MSG_CHECKING(Pro*C version)
244 ORACLE_HOME=$oracle release=`$ORACLE_HOME/bin/proc | awk '/Release/ {print $3;}'`
245 AC_MSG_RESULT($release)
246 case $release in
247 2.0.6.0.0)
248 SQL_LIBS="-L$oracle/lib -lsql $oracle/lib/osntab.o -lsqlnet -lora -lsqlnet -lnlsrtl -lcv6 -lcore -lnlsrtl -lcore -lm"
249 ;;
7e38e77c 250 2.2.4.0.0)
cd357ef5 251 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"
252 ;;
00274452 253 8.1.7.4.0)
dc02aea5 254 SQL_LIBS="-L$oracle/lib -lclntsh `cat $oracle/lib/sysliblist` -R$oracle/lib -laio -lm -lthread"
7e38e77c 255 ;;
00274452 256 10.2.0.2.0)
257 SQL_LIBS="-L$oracle/lib32 -lclntsh `cat $oracle/lib32/ldflags` `cat $oracle/lib32/sysliblist` -R$oracle/lib32 -laio -lposix4 -lm -lthread"
258 ;;
259 *)
260 AC_MSG_ERROR(Unsupported Oracle release)
261 ;;
cd357ef5 262 esac
ea0caf4a 263 SVRSUBDIRS='$(SVRDIRS)'
ac1784ed 264 SERVER_OUTPUT_FILES="db/Makefile server/Makefile backup/Makefile dbck/Makefile dcm/Makefile gen/Makefile incremental/Makefile incremental/mailman/Makefile reg_svr/Makefile regtape/Makefile"
ea0caf4a 265 PRO_C=$oracle/bin/proc
266 PRO_C_OPTS=CODE=ANSI_C
00274452 267 PRO_C_DEFS="DEFINE=_PROC_ DEFINE=__sparc $PRO_C_DEFS"
ea0caf4a 268fi
269AC_SUBST(PRO_C)
270AC_SUBST(PRO_C_DEFS)
271AC_SUBST(PRO_C_INCLUDES)
272AC_SUBST(PRO_C_OPTS)
273AC_SUBST(SQL_LIBS)
274AC_SUBST(SVRSUBDIRS)
275
3595c6c0 276# Java support, for webmoira
277AC_MSG_CHECKING(for Java)
278AC_ARG_WITH(java,
279 [ --with-java=PREFIX Specify location of Java libs and headers],
280 [ java="$withval"],
281 [if test -n "$JAVA_HOME" -a -d "$JAVA_HOME"; then
282 java=$JAVA_HOME
283 else
284 java=no
285 fi])
286AC_MSG_RESULT($java)
287if test "$java" != no; then
288 if test "$java" != yes; then
289 JAVA_CPPFLAGS="-I$java/include -I$java/include/$short_os"
290 fi
291 MR_DEFINE(HAVE_JAVA)
292
293 WEBMOIRA_SUBDIRS="webmoira"
294 WEBMOIRA_OUTPUT_FILES="webmoira/Makefile"
295fi
296AC_SUBST(JAVA_CPPFLAGS)
a5a4b554 297AC_SUBST(WEBMOIRA_SUBDIRS)
3595c6c0 298
9b1f5e48 299# LDAP support
300AC_MSG_CHECKING(for LDAP)
301AC_ARG_WITH(ldap,
302 [ --with-ldap=PREFIX Specify location of LDAP libs (for server)],
303 [ ldap="$withval"],
304 [if test -n "$LDAP_HOME" -a -d "$LDAP_HOME"; then
305 ldap=$LDAP_HOME
306 else
307 ldap=no
308 fi])
309AC_MSG_RESULT($ldap)
310if test "$ldap" != no -a "$oracle" != no; then
311 if test "$ldap" != yes; then
312 LDAP_CPPFLAGS="-I$ldap/include"
313 LDAP_LIBS="-L$ldap/lib"
314 fi
315 MR_DEFINE(HAVE_LDAP)
316
87db79ab 317 WINAD_SUBDIRS="winad ldap"
318 WINAD_OUTPUT_FILES="incremental/winad/Makefile incremental/ldap/Makefile"
9b1f5e48 319fi
320AC_SUBST(LDAP_CPPFLAGS)
321AC_SUBST(LDAP_LIBS)
322AC_SUBST(WINAD_SUBDIRS)
323
ea0caf4a 324# AFS support
325AC_MSG_CHECKING(for AFS)
326AC_ARG_WITH(afs,
327 [ --with-afs=PREFIX Specify location of AFS libs (for server)],
328 [afs="$withval"], [afs=no])
329AC_MSG_RESULT($afs)
330if test "$afs" != no -a "$oracle" != no; then
331 if test "$afs" != yes; then
332 AFS_CPPFLAGS="-I$afs/include -I$afs/include/afs -I$afs/include/rx"
333 AFS_PRO_C_INCLUDES="INCLUDE=$afs/include INCLUDE=$afs/include/afs INCLUDE=$afs/include/rx"
334 AFS_LIBS="-L$afs/lib -L$afs/lib/afs"
335 AFS_DIR=$afs
336 fi
ea0caf4a 337 AC_CHECK_LIB(sys, pioctl, :,
338 [AC_MSG_ERROR(AFS libraries not found)],
00274452 339 $AFS_LIBS -lrx -llwp -lsys -lafsutil)
ea0caf4a 340 MR_DEFINE(HAVE_AFS)
9ed720ef 341
9b1f5e48 342 AFS_SUBDIRS="afs"
343 AFS_OUTPUT_FILES="incremental/afs/Makefile"
9ed720ef 344 if test -d $srcdir/afssync; then
9b1f5e48 345 AFS_SYNCDIR="afssync"
9ed720ef 346 AFS_OUTPUT_FILES="$AFS_OUTPUT_FILES afssync/Makefile"
347 fi
ea0caf4a 348fi
349AC_SUBST(AFS_CPPFLAGS)
350AC_SUBST(AFS_PRO_C_INCLUDES)
351AC_SUBST(AFS_LIBS)
ea0caf4a 352AC_SUBST(AFS_DIR)
9ed720ef 353AC_SUBST(AFS_SUBDIRS)
9b1f5e48 354AC_SUBST(AFS_SYNCDIR)
ea0caf4a 355
356# GNU readline
357AC_CHECKING(for GNU readline...)
358AC_ARG_WITH(readline,
359 [ --with-readline=PREFIX Specify location of GNU readline],
ee85084d 360 [readline="$withval"; AC_MSG_RESULT($withval)],
361 [AC_CHECK_LIB(readline, readline, [readline=yes],
362 [if test "$athena" = true; then
363 unset ac_cv_lib_readline_readline
364 AC_CHECK_LIB(readline, readline, [readline=/mit/gnu], :,
365 -L/mit/gnu/lib -ltermcap)
366 fi],
367 -ltermcap)])
ea0caf4a 368if test "$readline" != no; then
369 if test "$readline" != yes; then
c5c5a18d 370 READLINE_CPPFLAGS="-I$readline/include"
ee85084d 371 READLINE_LIBS="-L$readline/lib"
ea0caf4a 372 fi
ee85084d 373 READLINE_CPPFLAGS="$READLINE_CPPFLAGS -DHAVE_READLINE"
374 READLINE_LIBS="$READLINE_LIBS -lreadline -ltermcap"
ea0caf4a 375fi
376AC_SUBST(READLINE_CPPFLAGS)
377AC_SUBST(READLINE_LIBS)
378
379# Curses
380curses=curses
381AC_CHECKING(for curses)
382AC_CHECK_LIB(curses, main, :, AC_CHECK_LIB(ncurses, main, curses=ncurses))
383if test -n "$curses"; then
384 OLDLIBS=$LIBS
385 LIBS=-l$curses
386 AC_CHECKING(if curses needs termcap)
387 dnl we need to use AC_TRY_RUN because under NetBSD, the program will
388 dnl link with just -lcurses, but then fail with a runtime linker error
389 dnl because you didn't use -ltermcap
390 AC_TRY_RUN([#include <curses.h>
391 main(int argc, char **argv)
392 {
393 initscr();
394 endwin();
395 return 0;
396 }], [CURSES_LIBS="-l$curses"],
397 LIBS="-l$curses -ltermcap"
398 AC_TRY_RUN([#include <curses.h>
399 main(int argc, char **argv)
400 {
401 initscr();
402 endwin();
403 return 0;
404 }], [CURSES_LIBS="-l$curses -ltermcap"],
405 :, :),
406 :)
407 LIBS=$OLDLIBS
408fi
409if test -n "$CURSES_LIBS"; then
410 OLDLIBS=$LIBS
411 LIBS=$CURSES_LIBS
412 AC_TRY_LINK([#include <curses.h>],[WINDOW *w; getmaxx(w);],
413 :,
414 AC_TRY_COMPILE([#include <curses.h>],[WINDOW *w; w->_maxx;],
415 [CURSES_CPPFLAGS="-D'getmaxx(w)=w->_maxx'"],
416 [CURSES_CPPFLAGS="-D'getmaxx(w)=w->maxx'"]))
4753fa79 417 AC_TRY_LINK([#include <curses.h>],[newterm(NULL, NULL, NULL);],
418 [CURSES_CPPFLAGS="$CURSES_CPPFLAGS -DCURSES_HAS_NEWTERM"])
ea0caf4a 419 LIBS=$OLDLIBS
420 CURSES_CPPFLAGS="-DHAVE_CURSES $CURSES_CPPFLAGS"
421 CURSES_SUBDIRS='$(CURSES_SUBDIRS)'
422else
423 AC_MSG_WARN(Couldn't find -lcurses)
424fi
425AC_SUBST(CURSES_CPPFLAGS)
426AC_SUBST(CURSES_LIBS)
427AC_SUBST(CURSES_SUBDIRS)
428
429
83a0db38 430AC_CHECK_FUNCS(getusershell strlcpy strlcat uname strvis)
533bacb3 431
432AC_CHECK_FUNC(sigaction, AC_DEFINE(HAVE_POSIX_SIGNALS))
433
7674bbe4 434AC_CHECK_HEADERS(unistd.h getopt.h)
435
436AC_CHECK_HEADER(netinet/in.h, AC_DEFINE(HAVE_NETINET_IN_H), no_netinet_in=yes)
437
438if test "$no_netinet_in" != "yes"; then
439 AC_MSG_CHECKING(for in_addr_t defined in netinet/in.h)
440 AC_EGREP_HEADER(in_addr_t, netinet/in.h,
441 ac_cv_type_in_addr_t=yes, ac_cv_type_in_addr_t=no)
442 AC_MSG_RESULT($ac_cv_type_in_addr_t)
443fi
444
445if test "$ac_cv_type_in_addr_t" != "yes"; then
446 AC_DEFINE(in_addr_t, uint32_t)
447fi
ea0caf4a 448
25f58600 449MR_EXTEND(PRO_C_INCLUDES, INCLUDE='$(srcdir)')
ea0caf4a 450MR_INCLUDE('$(SRCTOP)/include')
25f58600 451MR_INCLUDE('$(SRCTOP)/lib')
ea0caf4a 452MR_INCLUDE('$(BUILDTOP)/lib')
453MR_INCLUDE('$(BUILDTOP)/db')
f4036eed 454MR_INCLUDE('$(srcdir)')
ea0caf4a 455LDFLAGS="$LDFLAGS -L\$(BUILDTOP)/lib $LIBPATH"
cb974713 456KLIBS="$KRB4_LIBS $KRB5_LIBS -lcom_err $LIBS"
7249c66a 457KLIBS="$LIBS"
458if test "$hesiod" != no; then
459 KLIBS="-lhesiod $KLIBS"
460fi
cb974713 461KLIBS="$KRB4_LIBS $KRB5_LIBS -lcom_err $KLIBS"
7249c66a 462if test "$zephyr" != no; then
463 KLIBS="-lzephyr $KLIBS"
464fi
ea0caf4a 465LIBS="-lmoira $KLIBS"
466AC_SUBST(KLIBS)
467
3fb6166b 468MR_LIBDEP='$(BUILDTOP)/lib/libmoira.a'
469AC_SUBST(MR_LIBDEP)
470
ea0caf4a 471AC_OUTPUT(Makefile lib/Makefile include/Makefile clients/Makefile \
ee85084d 472 clients/lib/Makefile clients/addusr/Makefile \
f62cd5c0 473 clients/blanche/Makefile clients/chfn/Makefile \
474 clients/chpobox/Makefile clients/chsh/Makefile \
475 clients/mailmaint/Makefile clients/mitch/Makefile \
7cc696ad 476 clients/moira/Makefile clients/mrcheck/Makefile \
477 clients/mrtest/Makefile clients/stanley/Makefile \
478 clients/stella/Makefile update/Makefile man/Makefile \
479 $WEBMOIRA_OUTPUT_FILES $SERVER_OUTPUT_FILES $WINAD_OUTPUT_FILES \
480 $AFS_OUTPUT_FILES $RSAREF_OUTPUT_FILES)
This page took 0.256185 seconds and 5 git commands to generate.