1 | dnl $Id$ |
---|
2 | dnl Process this file with autoconf to produce a configure script. |
---|
3 | AC_INIT(owl.c) |
---|
4 | |
---|
5 | AC_CONFIG_HEADER(config.h) |
---|
6 | |
---|
7 | AC_PROG_CC |
---|
8 | |
---|
9 | dnl If we're using GCC, enable all warnings |
---|
10 | if test "$GCC" = yes; then |
---|
11 | CFLAGS="$CFLAGS -Wall -g"; |
---|
12 | fi |
---|
13 | |
---|
14 | m4_include(/usr/share/aclocal/pkg.m4) |
---|
15 | dnl m4_include(pkg.m4) |
---|
16 | |
---|
17 | dnl Check for Athena |
---|
18 | AC_MSG_CHECKING(for /usr/athena/include) |
---|
19 | if test -d /usr/athena/include; then |
---|
20 | CFLAGS=${CFLAGS}\ -I/usr/athena/include |
---|
21 | CPPFLAGS=${CPPFLAGS}\ -I/usr/athena/include |
---|
22 | AC_MSG_RESULT(yes) |
---|
23 | else |
---|
24 | AC_MSG_RESULT(no) |
---|
25 | fi |
---|
26 | AC_MSG_CHECKING(for /usr/athena/lib) |
---|
27 | if test -d /usr/athena/lib; then |
---|
28 | LDFLAGS=${LDFLAGS}\ -L/usr/athena/lib |
---|
29 | AC_MSG_RESULT(yes) |
---|
30 | else |
---|
31 | AC_MSG_RESULT(no) |
---|
32 | fi |
---|
33 | |
---|
34 | dnl Check for kerberosIV include |
---|
35 | AC_MSG_CHECKING(for kerberosIV) |
---|
36 | if test -d /usr/include/kerberosIV; then |
---|
37 | CFLAGS=${CFLAGS}\ -I/usr/include/kerberosIV |
---|
38 | CPPFLAGS=${CPPFLAGS}\ -I/usr/include/kerberosIV |
---|
39 | AC_MSG_RESULT(yes) |
---|
40 | elif test -d /usr/local/include/kerberosIV; then |
---|
41 | CFLAGS=${CFLAGS}\ -I/usr/local/include/kerberosIV |
---|
42 | CPPFLAGS=${CPPFLAGS}\ -I/usr/local/include/kerberosIV |
---|
43 | AC_MSG_RESULT(yes) |
---|
44 | else |
---|
45 | AC_MSG_RESULT(no) |
---|
46 | fi |
---|
47 | |
---|
48 | AC_CHECK_LIB(ncursesw, initscr,, AC_MSG_ERROR(No curses library found.)) |
---|
49 | AC_CHECK_LIB(com_err, com_err) |
---|
50 | AC_CHECK_LIB(nsl, gethostbyname) |
---|
51 | AC_CHECK_LIB(socket, socket) |
---|
52 | AC_CHECK_LIB(k5crypto, krb5_derive_key) |
---|
53 | dnl AC_CHECK_LIB(des425, req_act_vno) |
---|
54 | AC_CHECK_LIB(des425, des_cbc_encrypt) |
---|
55 | AC_CHECK_LIB(resolv, res_search) |
---|
56 | AC_CHECK_LIB(krb5, krb5_get_credentials) |
---|
57 | AC_CHECK_LIB(krb4, krb_sendauth,, |
---|
58 | AC_CHECK_LIB(krb, krb_sendauth)) |
---|
59 | dnl AC_CHECK_LIB(zephyr, ZGetSender,, AC_MSG_ERROR(No zephyr library found.)) |
---|
60 | AC_CHECK_LIB(zephyr, ZGetSender) |
---|
61 | AC_CHECK_LIB(zephyr, ZInitLocationInfo, AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [], [Have ZInitLocationInfo]),) |
---|
62 | |
---|
63 | AC_ARG_ENABLE([athstatic], AS_HELP_STRING([--enable-athstatic], |
---|
64 | [Statically link libraries in /usr/athena/lib]), |
---|
65 | [ATHSTATIC=./athstatic], |
---|
66 | [ATHSTATIC=]) |
---|
67 | |
---|
68 | AC_CHECK_FUNCS(use_default_colors resizeterm des_string_to_key des_key_sched des_ecb_encrypt) |
---|
69 | |
---|
70 | AC_MSG_CHECKING(for des_ecb_encrypt prototype) |
---|
71 | AC_TRY_COMPILE([#include <des.h> |
---|
72 | int des_ecb_encrypt(char foo[], char bar[], des_key_schedule baz, int qux);], |
---|
73 | [int foo = des_ecb_encrypt(0,0,0,0);], |
---|
74 | ac_cv_des_ecb_encrypt_proto=no, |
---|
75 | ac_cv_des_ecb_encrypt_proto=yes) |
---|
76 | AC_MSG_RESULT($ac_cv_des_ecb_encrypt_proto) |
---|
77 | if test "$ac_cv_des_ecb_encrypt_proto" = yes; then |
---|
78 | AC_DEFINE([HAVE_DES_ECB_ENCRYPT_PROTO], [], [have proto for des_ecb_encrypt]) |
---|
79 | fi |
---|
80 | |
---|
81 | dnl Checks for header files. |
---|
82 | AC_HEADER_STDC |
---|
83 | AC_HEADER_SYS_WAIT |
---|
84 | AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd.h com_err.h) |
---|
85 | |
---|
86 | dnl Add CFLAGS for embeded perl |
---|
87 | FOO=`perl -MExtUtils::Embed -e ccopts` |
---|
88 | echo Adding perl CFLAGS ${FOO} |
---|
89 | CFLAGS=${CFLAGS}\ ${FOO} |
---|
90 | |
---|
91 | dnl Find the location of perl XSUBPP |
---|
92 | AC_MSG_CHECKING(for the perl xsubpp precompiler) |
---|
93 | XSUBPPDIR="`(perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;') | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`" |
---|
94 | if test -n "${XSUBPPDIR}"; then |
---|
95 | AC_MSG_RESULT(${XSUBPPDIR}) |
---|
96 | else |
---|
97 | AC_MSG_ERROR(not found) |
---|
98 | fi |
---|
99 | |
---|
100 | if test -f "${XSUBPPDIR}/typemap"; then |
---|
101 | XSUBPPFLAGS="-typemap ${XSUBPPDIR}/typemap" |
---|
102 | else |
---|
103 | XSUBPPFLAGS="" |
---|
104 | fi |
---|
105 | |
---|
106 | dnl Add LDFLAGS for embedded perl |
---|
107 | FOO=`perl -MExtUtils::Embed -e ldopts` |
---|
108 | echo Adding perl LDFLAGS ${FOO} |
---|
109 | LDFLAGS=${LDFLAGS}\ ${FOO} |
---|
110 | |
---|
111 | dnl Add CFLAGS and LDFLAGS for glib-2.0 |
---|
112 | PKG_CHECK_MODULES(GLIB,glib-2.0) |
---|
113 | |
---|
114 | echo Adding glib-2.0 CFLAGS ${GLIB_CFLAGS} |
---|
115 | CFLAGS=${CFLAGS}\ ${GLIB_CFLAGS} |
---|
116 | echo Adding glib-2.0 LDFLAGS ${GLIB_LIBS} |
---|
117 | LDFLAGS=${LDFLAGS}\ ${GLIB_LIBS} |
---|
118 | |
---|
119 | |
---|
120 | dnl Checks for typedefs, structures, and compiler characteristics. |
---|
121 | |
---|
122 | AC_SUBST(XSUBPPDIR) |
---|
123 | AC_SUBST(XSUBPPFLAGS) |
---|
124 | AC_SUBST(ATHSTATIC) |
---|
125 | |
---|
126 | AC_PROG_INSTALL |
---|
127 | |
---|
128 | AC_CONFIG_SUBDIRS(libfaim) |
---|
129 | |
---|
130 | AC_OUTPUT(Makefile) |
---|