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