source: configure.ac @ c00ab5f

release-1.10release-1.4release-1.5release-1.6release-1.7release-1.8release-1.9
Last change on this file since c00ab5f was c50f589, checked in by Nelson Elhage <nelhage@mit.edu>, 15 years ago
Support --program-{prefix,suffix,transform}. Since our build scripts depend on being able to install a non-default name, we might as well use the standard options for supporting this.
  • Property mode set to 100644
File size: 4.3 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)
66dnl AC_CHECK_LIB(zephyr, ZGetSender,, AC_MSG_ERROR(No zephyr library found.))
67AC_CHECK_LIB(zephyr, ZGetSender)
68AC_CHECK_LIB(zephyr, ZInitLocationInfo, AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [], [Have ZInitLocationInfo]),)
69
70AC_ARG_ENABLE([athstatic], AS_HELP_STRING([--enable-athstatic],
71                                          [Statically link libraries in /usr/athena/lib]),
72                                          [ATHSTATIC=./athstatic],
73                                          [ATHSTATIC=])
74
75AC_CHECK_FUNCS(use_default_colors resizeterm des_string_to_key des_key_sched des_ecb_encrypt)
76AC_CHECK_FUNCS(                            DES_string_to_key  DES_ecb_encrypt DES_key_sched)
77
78AC_MSG_CHECKING(for des_ecb_encrypt prototype)
79AC_TRY_COMPILE([#include <des.h>
80int des_ecb_encrypt(char foo[], char bar[], des_key_schedule baz, int qux);],
81[int foo = des_ecb_encrypt(0,0,0,0);],
82ac_cv_des_ecb_encrypt_proto=no,
83ac_cv_des_ecb_encrypt_proto=yes)
84AC_MSG_RESULT($ac_cv_des_ecb_encrypt_proto)
85if test "$ac_cv_des_ecb_encrypt_proto" = yes; then
86        AC_DEFINE([HAVE_DES_ECB_ENCRYPT_PROTO], [], [have proto for des_ecb_encrypt])
87fi
88
89dnl Checks for header files.
90AC_HEADER_STDC
91AC_HEADER_SYS_WAIT
92AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd.h com_err.h)
93
94dnl Add CFLAGS for embeded perl
95FOO=`perl -MExtUtils::Embed -e ccopts`
96AC_MSG_NOTICE([Adding perl CFLAGS ${FOO}])
97CFLAGS=${CFLAGS}\ ${FOO}
98
99dnl Find the location of perl XSUBPP
100AC_MSG_CHECKING(for the perl xsubpp precompiler)
101XSUBPPDIR="`(perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;') | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`"
102if test -n "${XSUBPPDIR}"; then
103   AC_MSG_RESULT(${XSUBPPDIR})
104else
105   AC_MSG_ERROR(not found)
106fi
107
108if test -f "${XSUBPPDIR}/typemap"; then
109   XSUBPPFLAGS="-typemap ${XSUBPPDIR}/typemap"
110else
111   XSUBPPFLAGS=""
112fi
113
114dnl Add LDFLAGS for embedded perl
115FOO=`perl -MExtUtils::Embed -e ldopts`
116AC_MSG_NOTICE([Adding perl LDFLAGS ${FOO}])
117LDFLAGS=${LDFLAGS}\ ${FOO}
118
119dnl Add CFLAGS and LDFLAGS for glib-2.0
120PKG_CHECK_MODULES(GLIB,glib-2.0)
121
122AC_MSG_NOTICE([Adding glib-2.0 CFLAGS ${GLIB_CFLAGS}])
123CFLAGS="${GLIB_CFLAGS} ${CFLAGS}"
124AC_MSG_NOTICE([Adding glib-2.0 LDFLAGS ${GLIB_LIBS}])
125LDFLAGS="${GLIB_LIBS} ${LDFLAGS}"
126
127dnl Checks for typedefs, structures, and compiler characteristics.
128
129dnl Support --program-{prefix,suffix,transform}
130AC_ARG_PROGRAM
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.