source: configure.ac @ 5008e51

debianrelease-1.10release-1.4release-1.5release-1.6release-1.7release-1.8release-1.9
Last change on this file since 5008e51 was 87afe92, checked in by Sam Hartman <hartmans@mit.edu>, 16 years ago
Support -fstack-protector Gcc and some Linux environments support a -fstack-protector option to guard against buffer overflows. Sometimes this requires linking against -lssp. When this option works, use it in the build. Users may set PROTECT_CFLAGS to override.
  • Property mode set to 100644
File size: 4.1 KB
Line 
1dnl $Id$
2dnl Process this file with autoconf to produce a configure script.
3AC_INIT(owl.c)
4
5AC_CONFIG_HEADER(config.h)
6
7AC_PROG_CC
8
9dnl If we're using GCC, enable all warnings
10if test "$GCC" = yes; then
11     CFLAGS="$CFLAGS -Wall -g";
12fi
13
14m4_include(/usr/share/aclocal/pkg.m4)
15dnl m4_include(pkg.m4)
16
17dnl Check for Athena
18AC_MSG_CHECKING(for /usr/athena/include)
19if test -d /usr/athena/include; then
20        CFLAGS=${CFLAGS}\ -I/usr/athena/include
21        CPPFLAGS=${CPPFLAGS}\ -I/usr/athena/include
22        AC_MSG_RESULT(yes)
23else
24        AC_MSG_RESULT(no)
25fi
26AC_MSG_CHECKING(for /usr/athena/lib)
27if test -d /usr/athena/lib; then
28        LDFLAGS=${LDFLAGS}\ -L/usr/athena/lib
29        AC_MSG_RESULT(yes)
30else
31        AC_MSG_RESULT(no)
32fi
33
34dnl Check for kerberosIV include
35AC_MSG_CHECKING(for kerberosIV)
36if test -d /usr/include/kerberosIV; then
37        CFLAGS=${CFLAGS}\ -I/usr/include/kerberosIV
38        CPPFLAGS=${CPPFLAGS}\ -I/usr/include/kerberosIV
39        AC_MSG_RESULT(yes)
40elif test -d /usr/local/include/kerberosIV; then
41        CFLAGS=${CFLAGS}\ -I/usr/local/include/kerberosIV
42        CPPFLAGS=${CPPFLAGS}\ -I/usr/local/include/kerberosIV
43        AC_MSG_RESULT(yes)
44else
45        AC_MSG_RESULT(no)
46fi
47PROTECT_CFLAGS=${PROTECT_CFLAGS-"-fstack-protector"}
48SAVE_CFLAGS=$CFLAGS
49CFLAGS="$CFLAGS $PROTECT_CFLAGS"
50AC_MSG_CHECKING(whether protection cflags work)
51AC_COMPILE_IFELSE(int i;,
52    [AC_MSG_RESULT(yes)],
53    [AC_MSG_RESULT(no)
54    CFLAGS=$SAVE_CFLAGS])
55
56
57AC_CHECK_LIB(ssp, __stack_chk_guard)
58AC_CHECK_LIB(ncursesw, initscr,, AC_MSG_ERROR(No libncursesw found.))
59AC_CHECK_LIB(com_err, com_err)
60AC_CHECK_LIB(nsl, gethostbyname)
61AC_CHECK_LIB(socket, socket)
62AC_CHECK_LIB(k5crypto, krb5_derive_key)
63dnl AC_CHECK_LIB(des425, req_act_vno)
64AC_CHECK_LIB(des425, des_cbc_encrypt)
65AC_CHECK_LIB(resolv, res_search)
66AC_CHECK_LIB(krb5, krb5_get_credentials)
67AC_CHECK_LIB(krb4, krb_sendauth,,
68   AC_CHECK_LIB(krb, krb_sendauth))
69dnl AC_CHECK_LIB(zephyr, ZGetSender,, AC_MSG_ERROR(No zephyr library found.))
70AC_CHECK_LIB(zephyr, ZGetSender)
71AC_CHECK_LIB(zephyr, ZInitLocationInfo, AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [], [Have ZInitLocationInfo]),)
72
73AC_ARG_ENABLE([athstatic], AS_HELP_STRING([--enable-athstatic],
74                                          [Statically link libraries in /usr/athena/lib]),
75                                          [ATHSTATIC=./athstatic],
76                                          [ATHSTATIC=])
77
78AC_CHECK_FUNCS(use_default_colors resizeterm des_string_to_key des_key_sched des_ecb_encrypt)
79
80AC_MSG_CHECKING(for des_ecb_encrypt prototype)
81AC_TRY_COMPILE([#include <des.h>
82int des_ecb_encrypt(char foo[], char bar[], des_key_schedule baz, int qux);],
83[int foo = des_ecb_encrypt(0,0,0,0);],
84ac_cv_des_ecb_encrypt_proto=no,
85ac_cv_des_ecb_encrypt_proto=yes)
86AC_MSG_RESULT($ac_cv_des_ecb_encrypt_proto)
87if test "$ac_cv_des_ecb_encrypt_proto" = yes; then
88        AC_DEFINE([HAVE_DES_ECB_ENCRYPT_PROTO], [], [have proto for des_ecb_encrypt])
89fi
90
91dnl Checks for header files.
92AC_HEADER_STDC
93AC_HEADER_SYS_WAIT
94AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd.h com_err.h)
95
96dnl Add CFLAGS for embeded perl
97FOO=`perl -MExtUtils::Embed -e ccopts`
98echo Adding perl CFLAGS ${FOO}
99CFLAGS=${CFLAGS}\ ${FOO}
100
101dnl Find the location of perl XSUBPP
102AC_MSG_CHECKING(for the perl xsubpp precompiler)
103XSUBPPDIR="`(perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;') | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`"
104if test -n "${XSUBPPDIR}"; then
105   AC_MSG_RESULT(${XSUBPPDIR})
106else
107   AC_MSG_ERROR(not found)
108fi
109
110if test -f "${XSUBPPDIR}/typemap"; then
111   XSUBPPFLAGS="-typemap ${XSUBPPDIR}/typemap"
112else
113   XSUBPPFLAGS=""
114fi
115
116dnl Add LDFLAGS for embedded perl
117FOO=`perl -MExtUtils::Embed -e ldopts`
118echo Adding perl LDFLAGS ${FOO}
119LDFLAGS=${LDFLAGS}\ ${FOO}
120
121dnl Add CFLAGS and LDFLAGS for glib-2.0
122PKG_CHECK_MODULES(GLIB,glib-2.0)
123
124echo Adding glib-2.0 CFLAGS ${GLIB_CFLAGS}
125CFLAGS="${GLIB_CFLAGS} ${CFLAGS}"
126echo Adding glib-2.0 LDFLAGS ${GLIB_LIBS}
127LDFLAGS="${GLIB_LIBS} ${LDFLAGS}"
128
129
130dnl Checks for typedefs, structures, and compiler characteristics.
131
132AC_SUBST(XSUBPPDIR)
133AC_SUBST(XSUBPPFLAGS)
134AC_SUBST(ATHSTATIC)
135
136AC_PROG_INSTALL
137
138AC_CONFIG_SUBDIRS(libfaim)
139
140AC_OUTPUT(Makefile)
Note: See TracBrowser for help on using the repository browser.