source: configure.ac @ ecc958e

release-1.10release-1.4release-1.5release-1.6release-1.7release-1.8release-1.9
Last change on this file since ecc958e was ecc958e, checked in by Nelson Elhage <nelhage@mit.edu>, 15 years ago
Bump the version # for development.
  • Property mode set to 100644
File size: 4.8 KB
Line 
1dnl $Id$
2dnl Process this file with autoconf to produce a configure script.
3AC_INIT([BarnOwl],[1.4pre1],[bug-barnowl@mit.edu])
4AM_INIT_AUTOMAKE([-Wall foreign])
5
6AC_CONFIG_HEADER([config.h])
7
8AC_PROG_CC
9
10dnl Check for Athena
11AC_MSG_CHECKING(for /usr/athena/include)
12if 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)
16else
17        AC_MSG_RESULT(no)
18fi
19AC_MSG_CHECKING(for /usr/athena/lib)
20if test -d /usr/athena/lib; then
21        LDFLAGS=${LDFLAGS}\ -L/usr/athena/lib
22        AC_MSG_RESULT(yes)
23else
24        AC_MSG_RESULT(no)
25fi
26
27dnl Check for kerberosIV include
28AC_MSG_CHECKING(for kerberosIV)
29if 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)
33elif 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)
37elif 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)
41else
42        AC_MSG_RESULT(no)
43fi
44
45AC_ARG_WITH([stack-protector],
46  [AS_HELP_STRING([--with-stack-protector],
47    [Enable gcc -fstack-protector])],
48  [],
49  [with_stack_protector=check])
50
51AS_IF([test "x$with_stack_protector" != xno],
52  [
53    SAVE_CFLAGS=$CFLAGS
54    CFLAGS="$CFLAGS -fstack-protector"
55    AC_MSG_CHECKING(whether protection cflags work)
56    AC_COMPILE_IFELSE(int i;,
57        [AC_MSG_RESULT(yes)],
58        [AC_MSG_RESULT(no)
59        CFLAGS=$SAVE_CFLAGS
60        if test "x$with_stack_protector" != xcheck; then
61          AC_MSG_FAILURE([--with-stack-protector selected, but gcc does support it.])
62        fi])
63    AC_CHECK_LIB(ssp, __stack_chk_guard)
64  ])
65
66AC_CHECK_LIB(ncursesw, initscr,, AC_MSG_ERROR(No libncursesw found.))
67AC_CHECK_LIB(com_err, com_err)
68AC_CHECK_LIB(nsl, gethostbyname)
69AC_CHECK_LIB(socket, socket)
70dnl AC_CHECK_LIB(des425, req_act_vno)
71AC_CHECK_LIB(des425, des_cbc_encrypt,,AC_CHECK_LIB(crypto,DES_cbc_encrypt))
72AC_CHECK_LIB(resolv, res_search)
73
74AC_ARG_WITH([zephyr],
75  [AS_HELP_STRING([--with-libzephyr],
76    [Disable Zephyr support])],
77  [],
78  [with_zephyr=check])
79
80AS_IF([test "x$with_zephyr" != xno],
81  [AC_CHECK_LIB([zephyr], [ZGetSender],
82   [LIBS="$LIBS -lzephyr"
83    AC_DEFINE([HAVE_LIBZEPHYR], [1],
84                [Define if you have libzephyr])
85    AC_CHECK_LIB([zephyr], [ZInitLocationInfo],
86      AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [1],
87                [Have ZInitLocationInfo]),)
88   ],
89   [if test "x$with_zephyr" != xcheck; then
90      AC_MSG_FAILURE(
91        [--with-libzephyr was given, but libzephyr does not seem to be available.])
92    fi
93   ])])
94
95AC_CHECK_FUNCS(use_default_colors resizeterm des_string_to_key des_key_sched des_ecb_encrypt)
96AC_CHECK_FUNCS(                            DES_string_to_key  DES_ecb_encrypt DES_key_sched)
97
98AC_MSG_CHECKING(for des_ecb_encrypt prototype)
99AC_TRY_COMPILE([#include <des.h>
100int des_ecb_encrypt(char foo[], char bar[], des_key_schedule baz, int qux);],
101[int foo = des_ecb_encrypt(0,0,0,0);],
102ac_cv_des_ecb_encrypt_proto=no,
103ac_cv_des_ecb_encrypt_proto=yes)
104AC_MSG_RESULT($ac_cv_des_ecb_encrypt_proto)
105if test "$ac_cv_des_ecb_encrypt_proto" = yes; then
106        AC_DEFINE([HAVE_DES_ECB_ENCRYPT_PROTO], [], [have proto for des_ecb_encrypt])
107fi
108
109dnl Checks for header files.
110AC_HEADER_STDC
111AC_HEADER_SYS_WAIT
112AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd.h com_err.h)
113
114dnl Add CFLAGS for embeded perl
115FOO=`perl -MExtUtils::Embed -e ccopts`
116AC_MSG_NOTICE([Adding perl CFLAGS ${FOO}])
117CFLAGS=${CFLAGS}\ ${FOO}
118
119dnl Find the location of perl XSUBPP
120AC_MSG_CHECKING(for the perl xsubpp precompiler)
121XSUBPPDIR="`(perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;') | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`"
122if test -n "${XSUBPPDIR}"; then
123   AC_MSG_RESULT(${XSUBPPDIR})
124else
125   AC_MSG_ERROR(not found)
126fi
127
128if test -f "${XSUBPPDIR}/typemap"; then
129   XSUBPPFLAGS="-typemap ${XSUBPPDIR}/typemap"
130else
131   XSUBPPFLAGS=""
132fi
133
134dnl Add LDFLAGS for embedded perl
135FOO=`perl -MExtUtils::Embed -e ldopts`
136AC_MSG_NOTICE([Adding perl LIBS ${FOO}])
137LIBS=${LIBS}\ ${FOO}
138
139dnl Add CFLAGS and LDFLAGS for glib-2.0
140PKG_CHECK_MODULES(GLIB,glib-2.0)
141
142AC_MSG_NOTICE([Adding glib-2.0 CFLAGS ${GLIB_CFLAGS}])
143CFLAGS="${GLIB_CFLAGS} ${CFLAGS}"
144AC_MSG_NOTICE([Adding glib-2.0 LDFLAGS ${GLIB_LIBS}])
145LDFLAGS="${GLIB_LIBS} ${LDFLAGS}"
146
147if test "x${prefix}" = "xNONE"; then
148   prefix="${ac_default_prefix}"
149fi
150
151AC_DEFINE_UNQUOTED([DATADIR],["${prefix}/share/${PACKAGE}"],
152                   [Package data directory])
153
154dnl Checks for typedefs, structures, and compiler characteristics.
155
156AC_SUBST(XSUBPPDIR)
157AC_SUBST(XSUBPPFLAGS)
158
159AC_PROG_INSTALL
160AC_PROG_RANLIB
161
162AC_CONFIG_FILES([Makefile libfaim/Makefile perl/modules/Makefile])
163AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.