source: configure.ac @ ce27cc1

release-1.10release-1.4release-1.5release-1.6release-1.7release-1.8release-1.9
Last change on this file since ce27cc1 was ce27cc1, checked in by Anders Kaseorg <andersk@mit.edu>, 15 years ago
configure.ac: Reimplement -fstack-protector check with AX_C_CHECK_FLAG. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
  • Property mode set to 100644
File size: 4.7 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2AC_INIT([BarnOwl],[1.4pre1],[bug-barnowl@mit.edu])
3AM_INIT_AUTOMAKE([-Wall foreign])
4m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
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  [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
59AC_CHECK_LIB(ncursesw, initscr,, AC_MSG_ERROR(No libncursesw found.))
60AC_CHECK_LIB(com_err, com_err)
61AC_CHECK_LIB(nsl, gethostbyname)
62AC_CHECK_LIB(socket, socket)
63dnl AC_CHECK_LIB(des425, req_act_vno)
64AC_CHECK_LIB(des425, des_cbc_encrypt,,AC_CHECK_LIB(crypto,DES_cbc_encrypt))
65AC_CHECK_LIB(resolv, res_search)
66
67AC_ARG_WITH([zephyr],
68  [AS_HELP_STRING([--with-libzephyr],
69    [Enable Zephyr support])],
70  [],
71  [with_zephyr=check])
72
73AS_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
88AC_CHECK_FUNCS(use_default_colors resizeterm des_string_to_key des_key_sched des_ecb_encrypt)
89AC_CHECK_FUNCS(                            DES_string_to_key  DES_ecb_encrypt DES_key_sched)
90
91AC_MSG_CHECKING(for des_ecb_encrypt prototype)
92AC_TRY_COMPILE([#include <des.h>
93int des_ecb_encrypt(char foo[], char bar[], des_key_schedule baz, int qux);],
94[int foo = des_ecb_encrypt(0,0,0,0);],
95ac_cv_des_ecb_encrypt_proto=no,
96ac_cv_des_ecb_encrypt_proto=yes)
97AC_MSG_RESULT($ac_cv_des_ecb_encrypt_proto)
98if test "$ac_cv_des_ecb_encrypt_proto" = yes; then
99        AC_DEFINE([HAVE_DES_ECB_ENCRYPT_PROTO], [], [have proto for des_ecb_encrypt])
100fi
101
102dnl Checks for header files.
103AC_HEADER_STDC
104AC_HEADER_SYS_WAIT
105AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd.h com_err.h)
106
107dnl Add CFLAGS for embeded perl
108FOO=`perl -MExtUtils::Embed -e ccopts`
109AC_MSG_NOTICE([Adding perl CFLAGS ${FOO}])
110CFLAGS=${CFLAGS}\ ${FOO}
111
112dnl Find the location of perl XSUBPP
113AC_MSG_CHECKING(for the perl xsubpp precompiler)
114XSUBPPDIR="`(perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;') | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`"
115if test -n "${XSUBPPDIR}"; then
116   AC_MSG_RESULT(${XSUBPPDIR})
117else
118   AC_MSG_ERROR(not found)
119fi
120
121if test -f "${XSUBPPDIR}/typemap"; then
122   XSUBPPFLAGS="-typemap ${XSUBPPDIR}/typemap"
123else
124   XSUBPPFLAGS=""
125fi
126
127dnl Add LDFLAGS for embedded perl
128FOO=`perl -MExtUtils::Embed -e ldopts`
129AC_MSG_NOTICE([Adding perl LIBS ${FOO}])
130LIBS=${LIBS}\ ${FOO}
131
132dnl Add CFLAGS and LDFLAGS for glib-2.0
133PKG_CHECK_MODULES(GLIB,glib-2.0)
134
135AC_MSG_NOTICE([Adding glib-2.0 CFLAGS ${GLIB_CFLAGS}])
136CFLAGS="${GLIB_CFLAGS} ${CFLAGS}"
137AC_MSG_NOTICE([Adding glib-2.0 LDFLAGS ${GLIB_LIBS}])
138LDFLAGS="${GLIB_LIBS} ${LDFLAGS}"
139
140if test "x${prefix}" = "xNONE"; then
141   prefix="${ac_default_prefix}"
142fi
143
144AC_DEFINE_UNQUOTED([DATADIR],["${prefix}/share/${PACKAGE}"],
145                   [Package data directory])
146
147dnl Checks for typedefs, structures, and compiler characteristics.
148
149AC_SUBST(XSUBPPDIR)
150AC_SUBST(XSUBPPFLAGS)
151
152AC_PROG_INSTALL
153AC_PROG_RANLIB
154
155AC_CONFIG_FILES([Makefile libfaim/Makefile perl/modules/Makefile])
156AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.