1 | dnl $Id$ |
---|
2 | dnl Process this file with autoconf to produce a configure script. |
---|
3 | AC_INIT([BarnOwl],[1.1.2],[bug-barnowl@mit.edu]) |
---|
4 | AM_INIT_AUTOMAKE([-Wall foreign]) |
---|
5 | |
---|
6 | AC_CONFIG_HEADER([config.h]) |
---|
7 | |
---|
8 | AC_PROG_CC |
---|
9 | |
---|
10 | dnl Check for Athena |
---|
11 | AC_MSG_CHECKING(for /usr/athena/include) |
---|
12 | if test -d /usr/athena/include; then |
---|
13 | CFLAGS=${CFLAGS}\ -I/usr/athena/include |
---|
14 | CPPFLAGS=${CPPFLAGS}\ -I/usr/athena/include |
---|
15 | AC_MSG_RESULT(yes) |
---|
16 | else |
---|
17 | AC_MSG_RESULT(no) |
---|
18 | fi |
---|
19 | AC_MSG_CHECKING(for /usr/athena/lib) |
---|
20 | if test -d /usr/athena/lib; then |
---|
21 | LDFLAGS=${LDFLAGS}\ -L/usr/athena/lib |
---|
22 | AC_MSG_RESULT(yes) |
---|
23 | else |
---|
24 | AC_MSG_RESULT(no) |
---|
25 | fi |
---|
26 | |
---|
27 | dnl Check for kerberosIV include |
---|
28 | AC_MSG_CHECKING(for kerberosIV) |
---|
29 | if test -d /usr/include/kerberosIV; then |
---|
30 | CFLAGS=${CFLAGS}\ -I/usr/include/kerberosIV |
---|
31 | CPPFLAGS=${CPPFLAGS}\ -I/usr/include/kerberosIV |
---|
32 | AC_MSG_RESULT(yes) |
---|
33 | elif test -d /usr/local/include/kerberosIV; then |
---|
34 | CFLAGS=${CFLAGS}\ -I/usr/local/include/kerberosIV |
---|
35 | CPPFLAGS=${CPPFLAGS}\ -I/usr/local/include/kerberosIV |
---|
36 | AC_MSG_RESULT(yes) |
---|
37 | elif test -d /usr/include/openssl; then |
---|
38 | CFLAGS=${CFLAGS}\ -I/usr/include/openssl |
---|
39 | CPPFLAGS=${CPPFLAGS}\ -I/usr/include/openssl |
---|
40 | AC_MSG_RESULT(OpenSSL DES found instead) |
---|
41 | else |
---|
42 | AC_MSG_RESULT(no) |
---|
43 | fi |
---|
44 | PROTECT_CFLAGS=${PROTECT_CFLAGS-"-fstack-protector"} |
---|
45 | SAVE_CFLAGS=$CFLAGS |
---|
46 | CFLAGS="$CFLAGS $PROTECT_CFLAGS" |
---|
47 | AC_MSG_CHECKING(whether protection cflags work) |
---|
48 | AC_COMPILE_IFELSE(int i;, |
---|
49 | [AC_MSG_RESULT(yes)], |
---|
50 | [AC_MSG_RESULT(no) |
---|
51 | CFLAGS=$SAVE_CFLAGS]) |
---|
52 | |
---|
53 | |
---|
54 | AC_CHECK_LIB(ssp, __stack_chk_guard) |
---|
55 | AC_CHECK_LIB(ncursesw, initscr,, AC_MSG_ERROR(No libncursesw found.)) |
---|
56 | AC_CHECK_LIB(com_err, com_err) |
---|
57 | AC_CHECK_LIB(nsl, gethostbyname) |
---|
58 | AC_CHECK_LIB(socket, socket) |
---|
59 | dnl AC_CHECK_LIB(des425, req_act_vno) |
---|
60 | AC_CHECK_LIB(des425, des_cbc_encrypt,,AC_CHECK_LIB(crypto,DES_cbc_encrypt)) |
---|
61 | AC_CHECK_LIB(resolv, res_search) |
---|
62 | dnl AC_CHECK_LIB(zephyr, ZGetSender,, AC_MSG_ERROR(No zephyr library found.)) |
---|
63 | AC_CHECK_LIB(zephyr, ZGetSender) |
---|
64 | AC_CHECK_LIB(zephyr, ZInitLocationInfo, AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [], [Have ZInitLocationInfo]),) |
---|
65 | |
---|
66 | AC_ARG_ENABLE([athstatic], AS_HELP_STRING([--enable-athstatic], |
---|
67 | [Statically link libraries in /usr/athena/lib]), |
---|
68 | [ATHSTATIC=./athstatic], |
---|
69 | [ATHSTATIC=]) |
---|
70 | |
---|
71 | AC_CHECK_FUNCS(use_default_colors resizeterm des_string_to_key des_key_sched des_ecb_encrypt) |
---|
72 | AC_CHECK_FUNCS( DES_string_to_key DES_ecb_encrypt DES_key_sched) |
---|
73 | |
---|
74 | AC_MSG_CHECKING(for des_ecb_encrypt prototype) |
---|
75 | AC_TRY_COMPILE([#include <des.h> |
---|
76 | int des_ecb_encrypt(char foo[], char bar[], des_key_schedule baz, int qux);], |
---|
77 | [int foo = des_ecb_encrypt(0,0,0,0);], |
---|
78 | ac_cv_des_ecb_encrypt_proto=no, |
---|
79 | ac_cv_des_ecb_encrypt_proto=yes) |
---|
80 | AC_MSG_RESULT($ac_cv_des_ecb_encrypt_proto) |
---|
81 | if test "$ac_cv_des_ecb_encrypt_proto" = yes; then |
---|
82 | AC_DEFINE([HAVE_DES_ECB_ENCRYPT_PROTO], [], [have proto for des_ecb_encrypt]) |
---|
83 | fi |
---|
84 | |
---|
85 | dnl Checks for header files. |
---|
86 | AC_HEADER_STDC |
---|
87 | AC_HEADER_SYS_WAIT |
---|
88 | AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd.h com_err.h) |
---|
89 | |
---|
90 | dnl Add CFLAGS for embeded perl |
---|
91 | FOO=`perl -MExtUtils::Embed -e ccopts` |
---|
92 | AC_MSG_NOTICE([Adding perl CFLAGS ${FOO}]) |
---|
93 | CFLAGS=${CFLAGS}\ ${FOO} |
---|
94 | |
---|
95 | dnl Find the location of perl XSUBPP |
---|
96 | AC_MSG_CHECKING(for the perl xsubpp precompiler) |
---|
97 | XSUBPPDIR="`(perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;') | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`" |
---|
98 | if test -n "${XSUBPPDIR}"; then |
---|
99 | AC_MSG_RESULT(${XSUBPPDIR}) |
---|
100 | else |
---|
101 | AC_MSG_ERROR(not found) |
---|
102 | fi |
---|
103 | |
---|
104 | if test -f "${XSUBPPDIR}/typemap"; then |
---|
105 | XSUBPPFLAGS="-typemap ${XSUBPPDIR}/typemap" |
---|
106 | else |
---|
107 | XSUBPPFLAGS="" |
---|
108 | fi |
---|
109 | |
---|
110 | dnl Add LDFLAGS for embedded perl |
---|
111 | FOO=`perl -MExtUtils::Embed -e ldopts` |
---|
112 | AC_MSG_NOTICE([Adding perl LDFLAGS ${FOO}]) |
---|
113 | LDFLAGS=${LDFLAGS}\ ${FOO} |
---|
114 | |
---|
115 | dnl Add CFLAGS and LDFLAGS for glib-2.0 |
---|
116 | PKG_CHECK_MODULES(GLIB,glib-2.0) |
---|
117 | |
---|
118 | AC_MSG_NOTICE([Adding glib-2.0 CFLAGS ${GLIB_CFLAGS}]) |
---|
119 | CFLAGS="${GLIB_CFLAGS} ${CFLAGS}" |
---|
120 | AC_MSG_NOTICE([Adding glib-2.0 LDFLAGS ${GLIB_LIBS}]) |
---|
121 | LDFLAGS="${GLIB_LIBS} ${LDFLAGS}" |
---|
122 | |
---|
123 | if test "x${prefix}" = "xNONE"; then |
---|
124 | prefix="${ac_default_prefix}" |
---|
125 | fi |
---|
126 | |
---|
127 | AC_DEFINE_UNQUOTED([DATADIR],["${prefix}/share/${PACKAGE}"], |
---|
128 | [Package data directory]) |
---|
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 | AC_PROG_RANLIB |
---|
138 | |
---|
139 | AC_CONFIG_FILES([Makefile libfaim/Makefile]) |
---|
140 | AC_OUTPUT([perl/modules/Makefile]) |
---|