1 | dnl Process this file with autoconf to produce a configure script. |
---|
2 | AC_INIT([BarnOwl],[1.4pre1],[bug-barnowl@mit.edu]) |
---|
3 | AM_INIT_AUTOMAKE([-Wall foreign]) |
---|
4 | m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) |
---|
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 | |
---|
45 | AC_ARG_WITH([stack-protector], |
---|
46 | [AS_HELP_STRING([--with-stack-protector], |
---|
47 | [Enable gcc -fstack-protector])], |
---|
48 | [], |
---|
49 | [with_stack_protector=check]) |
---|
50 | |
---|
51 | AS_IF([test "x$with_stack_protector" != xno], |
---|
52 | [AX_C_CHECK_FLAG([-fstack-protector],[],[], |
---|
53 | [CFLAGS="$CFLAGS -fstack-protector"], |
---|
54 | [if test "x$with_stack_protector" != xcheck; then |
---|
55 | AC_MSG_FAILURE([--with-stack-protector selected, but gcc does support it.]) |
---|
56 | fi |
---|
57 | ])]) |
---|
58 | |
---|
59 | AC_CHECK_LIB(ncursesw, initscr,, AC_MSG_ERROR(No libncursesw found.)) |
---|
60 | AC_CHECK_LIB(com_err, com_err) |
---|
61 | AC_CHECK_LIB(nsl, gethostbyname) |
---|
62 | AC_CHECK_LIB(socket, socket) |
---|
63 | dnl AC_CHECK_LIB(des425, req_act_vno) |
---|
64 | AC_CHECK_LIB(des425, des_cbc_encrypt,,AC_CHECK_LIB(crypto,DES_cbc_encrypt)) |
---|
65 | AC_CHECK_LIB(resolv, res_search) |
---|
66 | |
---|
67 | AC_ARG_WITH([zephyr], |
---|
68 | [AS_HELP_STRING([--with-libzephyr], |
---|
69 | [Enable Zephyr support])], |
---|
70 | [], |
---|
71 | [with_zephyr=check]) |
---|
72 | |
---|
73 | AS_IF([test "x$with_zephyr" != xno], |
---|
74 | [AC_CHECK_LIB([zephyr], [ZGetSender], |
---|
75 | [LIBS="$LIBS -lzephyr" |
---|
76 | AC_DEFINE([HAVE_LIBZEPHYR], [1], |
---|
77 | [Define if you have libzephyr]) |
---|
78 | AC_CHECK_LIB([zephyr], [ZInitLocationInfo], |
---|
79 | AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [1], |
---|
80 | [Have ZInitLocationInfo]),) |
---|
81 | ], |
---|
82 | [if test "x$with_zephyr" != xcheck; then |
---|
83 | AC_MSG_FAILURE( |
---|
84 | [--with-libzephyr was given, but libzephyr does not seem to be available.]) |
---|
85 | fi |
---|
86 | ])]) |
---|
87 | |
---|
88 | AC_CHECK_FUNCS(use_default_colors resizeterm des_string_to_key des_key_sched des_ecb_encrypt) |
---|
89 | AC_CHECK_FUNCS( DES_string_to_key DES_ecb_encrypt DES_key_sched) |
---|
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 | AC_MSG_NOTICE([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 | AC_MSG_NOTICE([Adding perl LIBS ${FOO}]) |
---|
119 | LIBS=${LIBS}\ ${FOO} |
---|
120 | |
---|
121 | dnl Add CFLAGS and LDFLAGS for glib-2.0 |
---|
122 | PKG_CHECK_MODULES(GLIB,glib-2.0) |
---|
123 | |
---|
124 | AC_MSG_NOTICE([Adding glib-2.0 CFLAGS ${GLIB_CFLAGS}]) |
---|
125 | CFLAGS="${GLIB_CFLAGS} ${CFLAGS}" |
---|
126 | AC_MSG_NOTICE([Adding glib-2.0 LDFLAGS ${GLIB_LIBS}]) |
---|
127 | LDFLAGS="${GLIB_LIBS} ${LDFLAGS}" |
---|
128 | |
---|
129 | if test "x${prefix}" = "xNONE"; then |
---|
130 | prefix="${ac_default_prefix}" |
---|
131 | fi |
---|
132 | |
---|
133 | AC_DEFINE_UNQUOTED([DATADIR],["${prefix}/share/${PACKAGE}"], |
---|
134 | [Package data directory]) |
---|
135 | |
---|
136 | dnl Checks for typedefs, structures, and compiler characteristics. |
---|
137 | |
---|
138 | AX_C_CHECK_FLAG([-Wno-pointer-sign],[],[], |
---|
139 | [LIBFAIM_CFLAGS="$LIBFAIM_CFLAGS -Wno-pointer-sign"]) |
---|
140 | |
---|
141 | AC_SUBST([LIBFAIM_CFLAGS]) |
---|
142 | |
---|
143 | AC_SUBST(XSUBPPDIR) |
---|
144 | AC_SUBST(XSUBPPFLAGS) |
---|
145 | |
---|
146 | AC_PROG_INSTALL |
---|
147 | AC_PROG_RANLIB |
---|
148 | |
---|
149 | AC_CONFIG_FILES([Makefile libfaim/Makefile perl/modules/Makefile]) |
---|
150 | AC_OUTPUT |
---|