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 | PROTECT_CFLAGS=${PROTECT_CFLAGS-"-fstack-protector"} |
---|
48 | SAVE_CFLAGS=$CFLAGS |
---|
49 | CFLAGS="$CFLAGS $PROTECT_CFLAGS" |
---|
50 | AC_MSG_CHECKING(whether protection cflags work) |
---|
51 | AC_COMPILE_IFELSE(int i;, |
---|
52 | [AC_MSG_RESULT(yes)], |
---|
53 | [AC_MSG_RESULT(no) |
---|
54 | CFLAGS=$SAVE_CFLAGS]) |
---|
55 | |
---|
56 | |
---|
57 | AC_CHECK_LIB(ssp, __stack_chk_guard) |
---|
58 | AC_CHECK_LIB(ncursesw, initscr,, AC_MSG_ERROR(No libncursesw found.)) |
---|
59 | AC_CHECK_LIB(com_err, com_err) |
---|
60 | AC_CHECK_LIB(nsl, gethostbyname) |
---|
61 | AC_CHECK_LIB(socket, socket) |
---|
62 | AC_CHECK_LIB(k5crypto, krb5_derive_key) |
---|
63 | dnl AC_CHECK_LIB(des425, req_act_vno) |
---|
64 | AC_CHECK_LIB(des425, des_cbc_encrypt) |
---|
65 | AC_CHECK_LIB(resolv, res_search) |
---|
66 | AC_CHECK_LIB(krb5, krb5_get_credentials) |
---|
67 | AC_CHECK_LIB(krb4, krb_sendauth,, |
---|
68 | AC_CHECK_LIB(krb, krb_sendauth)) |
---|
69 | dnl AC_CHECK_LIB(zephyr, ZGetSender,, AC_MSG_ERROR(No zephyr library found.)) |
---|
70 | AC_CHECK_LIB(zephyr, ZGetSender) |
---|
71 | AC_CHECK_LIB(zephyr, ZInitLocationInfo, AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [], [Have ZInitLocationInfo]),) |
---|
72 | |
---|
73 | AC_ARG_ENABLE([athstatic], AS_HELP_STRING([--enable-athstatic], |
---|
74 | [Statically link libraries in /usr/athena/lib]), |
---|
75 | [ATHSTATIC=./athstatic], |
---|
76 | [ATHSTATIC=]) |
---|
77 | |
---|
78 | AC_CHECK_FUNCS(use_default_colors resizeterm des_string_to_key des_key_sched des_ecb_encrypt) |
---|
79 | |
---|
80 | AC_MSG_CHECKING(for des_ecb_encrypt prototype) |
---|
81 | AC_TRY_COMPILE([#include <des.h> |
---|
82 | int des_ecb_encrypt(char foo[], char bar[], des_key_schedule baz, int qux);], |
---|
83 | [int foo = des_ecb_encrypt(0,0,0,0);], |
---|
84 | ac_cv_des_ecb_encrypt_proto=no, |
---|
85 | ac_cv_des_ecb_encrypt_proto=yes) |
---|
86 | AC_MSG_RESULT($ac_cv_des_ecb_encrypt_proto) |
---|
87 | if test "$ac_cv_des_ecb_encrypt_proto" = yes; then |
---|
88 | AC_DEFINE([HAVE_DES_ECB_ENCRYPT_PROTO], [], [have proto for des_ecb_encrypt]) |
---|
89 | fi |
---|
90 | |
---|
91 | dnl Checks for header files. |
---|
92 | AC_HEADER_STDC |
---|
93 | AC_HEADER_SYS_WAIT |
---|
94 | AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd.h com_err.h) |
---|
95 | |
---|
96 | dnl Add CFLAGS for embeded perl |
---|
97 | FOO=`perl -MExtUtils::Embed -e ccopts` |
---|
98 | echo Adding perl CFLAGS ${FOO} |
---|
99 | CFLAGS=${CFLAGS}\ ${FOO} |
---|
100 | |
---|
101 | dnl Find the location of perl XSUBPP |
---|
102 | AC_MSG_CHECKING(for the perl xsubpp precompiler) |
---|
103 | XSUBPPDIR="`(perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;') | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`" |
---|
104 | if test -n "${XSUBPPDIR}"; then |
---|
105 | AC_MSG_RESULT(${XSUBPPDIR}) |
---|
106 | else |
---|
107 | AC_MSG_ERROR(not found) |
---|
108 | fi |
---|
109 | |
---|
110 | if test -f "${XSUBPPDIR}/typemap"; then |
---|
111 | XSUBPPFLAGS="-typemap ${XSUBPPDIR}/typemap" |
---|
112 | else |
---|
113 | XSUBPPFLAGS="" |
---|
114 | fi |
---|
115 | |
---|
116 | dnl Add LDFLAGS for embedded perl |
---|
117 | FOO=`perl -MExtUtils::Embed -e ldopts` |
---|
118 | echo Adding perl LDFLAGS ${FOO} |
---|
119 | LDFLAGS=${LDFLAGS}\ ${FOO} |
---|
120 | |
---|
121 | dnl Add CFLAGS and LDFLAGS for glib-2.0 |
---|
122 | PKG_CHECK_MODULES(GLIB,glib-2.0) |
---|
123 | |
---|
124 | echo Adding glib-2.0 CFLAGS ${GLIB_CFLAGS} |
---|
125 | CFLAGS="${GLIB_CFLAGS} ${CFLAGS}" |
---|
126 | echo Adding glib-2.0 LDFLAGS ${GLIB_LIBS} |
---|
127 | LDFLAGS="${GLIB_LIBS} ${LDFLAGS}" |
---|
128 | |
---|
129 | |
---|
130 | dnl Checks for typedefs, structures, and compiler characteristics. |
---|
131 | |
---|
132 | AC_SUBST(XSUBPPDIR) |
---|
133 | AC_SUBST(XSUBPPFLAGS) |
---|
134 | AC_SUBST(ATHSTATIC) |
---|
135 | |
---|
136 | AC_PROG_INSTALL |
---|
137 | |
---|
138 | AC_CONFIG_SUBDIRS(libfaim) |
---|
139 | |
---|
140 | AC_OUTPUT(Makefile) |
---|