source: configure.ac @ b9df757

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