source: configure.ac @ e6d989f

release-1.4release-1.5release-1.6release-1.7release-1.8release-1.9
Last change on this file since e6d989f was 2c270e6, checked in by Nelson Elhage <nelhage@mit.edu>, 12 years ago
configure: Support an explicit --with{out,}-zephyr option.
  • 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   [AC_DEFINE([HAVE_LIBZEPHYR], [1],
76                [Define if you have libzephyr])
77    AC_CHECK_LIB([zephyr], [ZInitLocationInfo],
78      AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [1],
79                [Have ZInitLocationInfo]),)
80   ],
81   [if test "x$with_zephyr" != xcheck; then
82      AC_MSG_FAILURE(
83        [--with-libzephyr was given, but libzephyr does not seem to be available.])
84    fi
85   ])])
86
87AC_ARG_ENABLE([athstatic], AS_HELP_STRING([--enable-athstatic],
88                                          [Statically link libraries in /usr/athena/lib]),
89                                          [ATHSTATIC=./athstatic],
90                                          [ATHSTATIC=])
91
92AC_CHECK_FUNCS(use_default_colors resizeterm des_string_to_key des_key_sched des_ecb_encrypt)
93AC_CHECK_FUNCS(                            DES_string_to_key  DES_ecb_encrypt DES_key_sched)
94
95AC_MSG_CHECKING(for des_ecb_encrypt prototype)
96AC_TRY_COMPILE([#include <des.h>
97int des_ecb_encrypt(char foo[], char bar[], des_key_schedule baz, int qux);],
98[int foo = des_ecb_encrypt(0,0,0,0);],
99ac_cv_des_ecb_encrypt_proto=no,
100ac_cv_des_ecb_encrypt_proto=yes)
101AC_MSG_RESULT($ac_cv_des_ecb_encrypt_proto)
102if test "$ac_cv_des_ecb_encrypt_proto" = yes; then
103        AC_DEFINE([HAVE_DES_ECB_ENCRYPT_PROTO], [], [have proto for des_ecb_encrypt])
104fi
105
106dnl Checks for header files.
107AC_HEADER_STDC
108AC_HEADER_SYS_WAIT
109AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd.h com_err.h)
110
111dnl Add CFLAGS for embeded perl
112FOO=`perl -MExtUtils::Embed -e ccopts`
113AC_MSG_NOTICE([Adding perl CFLAGS ${FOO}])
114CFLAGS=${CFLAGS}\ ${FOO}
115
116dnl Find the location of perl XSUBPP
117AC_MSG_CHECKING(for the perl xsubpp precompiler)
118XSUBPPDIR="`(perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;') | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`"
119if test -n "${XSUBPPDIR}"; then
120   AC_MSG_RESULT(${XSUBPPDIR})
121else
122   AC_MSG_ERROR(not found)
123fi
124
125if test -f "${XSUBPPDIR}/typemap"; then
126   XSUBPPFLAGS="-typemap ${XSUBPPDIR}/typemap"
127else
128   XSUBPPFLAGS=""
129fi
130
131dnl Add LDFLAGS for embedded perl
132FOO=`perl -MExtUtils::Embed -e ldopts`
133AC_MSG_NOTICE([Adding perl LDFLAGS ${FOO}])
134LDFLAGS=${LDFLAGS}\ ${FOO}
135
136dnl Add CFLAGS and LDFLAGS for glib-2.0
137PKG_CHECK_MODULES(GLIB,glib-2.0)
138
139AC_MSG_NOTICE([Adding glib-2.0 CFLAGS ${GLIB_CFLAGS}])
140CFLAGS="${GLIB_CFLAGS} ${CFLAGS}"
141AC_MSG_NOTICE([Adding glib-2.0 LDFLAGS ${GLIB_LIBS}])
142LDFLAGS="${GLIB_LIBS} ${LDFLAGS}"
143
144dnl Checks for typedefs, structures, and compiler characteristics.
145
146dnl Support --program-{prefix,suffix,transform}
147AC_ARG_PROGRAM
148
149AC_SUBST(XSUBPPDIR)
150AC_SUBST(XSUBPPFLAGS)
151AC_SUBST(ATHSTATIC)
152
153AC_PROG_INSTALL
154
155AC_CONFIG_SUBDIRS(libfaim)
156
157AC_OUTPUT(Makefile)
Note: See TracBrowser for help on using the repository browser.