source: configure.ac @ 16c0416

release-1.4release-1.5release-1.6release-1.7release-1.8release-1.9
Last change on this file since 16c0416 was 16c0416, checked in by Nelson Elhage <nelhage@mit.edu>, 12 years ago
Fix building with Zephyr.
  • Property mode set to 100644
File size: 4.7 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
14dnl Check for Athena
15AC_MSG_CHECKING(for /usr/athena/include)
16if test -d /usr/athena/include; then
17        CFLAGS=${CFLAGS}\ -I/usr/athena/include
18        CPPFLAGS=${CPPFLAGS}\ -I/usr/athena/include
19        AC_MSG_RESULT(yes)
20else
21        AC_MSG_RESULT(no)
22fi
23AC_MSG_CHECKING(for /usr/athena/lib)
24if test -d /usr/athena/lib; then
25        LDFLAGS=${LDFLAGS}\ -L/usr/athena/lib
26        AC_MSG_RESULT(yes)
27else
28        AC_MSG_RESULT(no)
29fi
30
31dnl Check for kerberosIV include
32AC_MSG_CHECKING(for kerberosIV)
33if test -d /usr/include/kerberosIV; then
34        CFLAGS=${CFLAGS}\ -I/usr/include/kerberosIV
35        CPPFLAGS=${CPPFLAGS}\ -I/usr/include/kerberosIV
36        AC_MSG_RESULT(yes)
37elif test -d /usr/local/include/kerberosIV; then
38        CFLAGS=${CFLAGS}\ -I/usr/local/include/kerberosIV
39        CPPFLAGS=${CPPFLAGS}\ -I/usr/local/include/kerberosIV
40        AC_MSG_RESULT(yes)
41elif test -d /usr/include/openssl; then
42        CFLAGS=${CFLAGS}\ -I/usr/include/openssl
43        CPPFLAGS=${CPPFLAGS}\ -I/usr/include/openssl
44        AC_MSG_RESULT(OpenSSL DES found instead)
45else
46        AC_MSG_RESULT(no)
47fi
48PROTECT_CFLAGS=${PROTECT_CFLAGS-"-fstack-protector"}
49SAVE_CFLAGS=$CFLAGS
50CFLAGS="$CFLAGS $PROTECT_CFLAGS"
51AC_MSG_CHECKING(whether protection cflags work)
52AC_COMPILE_IFELSE(int i;,
53    [AC_MSG_RESULT(yes)],
54    [AC_MSG_RESULT(no)
55    CFLAGS=$SAVE_CFLAGS])
56
57
58AC_CHECK_LIB(ssp, __stack_chk_guard)
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    [Disable 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_ARG_ENABLE([athstatic], AS_HELP_STRING([--enable-athstatic],
89                                          [Statically link libraries in /usr/athena/lib]),
90                                          [ATHSTATIC=./athstatic],
91                                          [ATHSTATIC=])
92
93AC_CHECK_FUNCS(use_default_colors resizeterm des_string_to_key des_key_sched des_ecb_encrypt)
94AC_CHECK_FUNCS(                            DES_string_to_key  DES_ecb_encrypt DES_key_sched)
95
96AC_MSG_CHECKING(for des_ecb_encrypt prototype)
97AC_TRY_COMPILE([#include <des.h>
98int des_ecb_encrypt(char foo[], char bar[], des_key_schedule baz, int qux);],
99[int foo = des_ecb_encrypt(0,0,0,0);],
100ac_cv_des_ecb_encrypt_proto=no,
101ac_cv_des_ecb_encrypt_proto=yes)
102AC_MSG_RESULT($ac_cv_des_ecb_encrypt_proto)
103if test "$ac_cv_des_ecb_encrypt_proto" = yes; then
104        AC_DEFINE([HAVE_DES_ECB_ENCRYPT_PROTO], [], [have proto for des_ecb_encrypt])
105fi
106
107dnl Checks for header files.
108AC_HEADER_STDC
109AC_HEADER_SYS_WAIT
110AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd.h com_err.h)
111
112dnl Add CFLAGS for embeded perl
113FOO=`perl -MExtUtils::Embed -e ccopts`
114AC_MSG_NOTICE([Adding perl CFLAGS ${FOO}])
115CFLAGS=${CFLAGS}\ ${FOO}
116
117dnl Find the location of perl XSUBPP
118AC_MSG_CHECKING(for the perl xsubpp precompiler)
119XSUBPPDIR="`(perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;') | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`"
120if test -n "${XSUBPPDIR}"; then
121   AC_MSG_RESULT(${XSUBPPDIR})
122else
123   AC_MSG_ERROR(not found)
124fi
125
126if test -f "${XSUBPPDIR}/typemap"; then
127   XSUBPPFLAGS="-typemap ${XSUBPPDIR}/typemap"
128else
129   XSUBPPFLAGS=""
130fi
131
132dnl Add LDFLAGS for embedded perl
133FOO=`perl -MExtUtils::Embed -e ldopts`
134AC_MSG_NOTICE([Adding perl LDFLAGS ${FOO}])
135LDFLAGS=${LDFLAGS}\ ${FOO}
136
137dnl Add CFLAGS and LDFLAGS for glib-2.0
138PKG_CHECK_MODULES(GLIB,glib-2.0)
139
140AC_MSG_NOTICE([Adding glib-2.0 CFLAGS ${GLIB_CFLAGS}])
141CFLAGS="${GLIB_CFLAGS} ${CFLAGS}"
142AC_MSG_NOTICE([Adding glib-2.0 LDFLAGS ${GLIB_LIBS}])
143LDFLAGS="${GLIB_LIBS} ${LDFLAGS}"
144
145dnl Checks for typedefs, structures, and compiler characteristics.
146
147dnl Support --program-{prefix,suffix,transform}
148AC_ARG_PROGRAM
149
150AC_SUBST(XSUBPPDIR)
151AC_SUBST(XSUBPPFLAGS)
152AC_SUBST(ATHSTATIC)
153
154AC_PROG_INSTALL
155
156AC_CONFIG_SUBDIRS(libfaim)
157
158AC_OUTPUT(Makefile)
Note: See TracBrowser for help on using the repository browser.