1 | dnl $Id$ |
---|
2 | dnl Process this file with autoconf to produce a configure script. |
---|
3 | AC_INIT(owl.c) |
---|
4 | |
---|
5 | AC_CONFIG_HEADER(config.h) |
---|
6 | |
---|
7 | AC_PROG_CC |
---|
8 | |
---|
9 | dnl If we're using GCC, enable all warnings |
---|
10 | if test "$GCC" = yes; then |
---|
11 | CFLAGS="$CFLAGS -Wall -g"; |
---|
12 | fi |
---|
13 | |
---|
14 | dnl Check for Athena |
---|
15 | AC_MSG_CHECKING(for /usr/athena/include) |
---|
16 | if 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) |
---|
20 | else |
---|
21 | AC_MSG_RESULT(no) |
---|
22 | fi |
---|
23 | AC_MSG_CHECKING(for /usr/athena/lib) |
---|
24 | if test -d /usr/athena/lib; then |
---|
25 | LDFLAGS=${LDFLAGS}\ -L/usr/athena/lib |
---|
26 | AC_MSG_RESULT(yes) |
---|
27 | else |
---|
28 | AC_MSG_RESULT(no) |
---|
29 | fi |
---|
30 | |
---|
31 | dnl Check for kerberosIV include |
---|
32 | AC_MSG_CHECKING(for kerberosIV) |
---|
33 | if 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) |
---|
37 | elif 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) |
---|
41 | else |
---|
42 | AC_MSG_RESULT(no) |
---|
43 | fi |
---|
44 | PROTECT_CFLAGS=${PROTECT_CFLAGS-"-fstack-protector"} |
---|
45 | SAVE_CFLAGS=$CFLAGS |
---|
46 | CFLAGS="$CFLAGS $PROTECT_CFLAGS" |
---|
47 | AC_MSG_CHECKING(whether protection cflags work) |
---|
48 | AC_COMPILE_IFELSE(int i;, |
---|
49 | [AC_MSG_RESULT(yes)], |
---|
50 | [AC_MSG_RESULT(no) |
---|
51 | CFLAGS=$SAVE_CFLAGS]) |
---|
52 | |
---|
53 | |
---|
54 | AC_CHECK_LIB(ssp, __stack_chk_guard) |
---|
55 | AC_CHECK_LIB(ncursesw, initscr,, AC_MSG_ERROR(No libncursesw found.)) |
---|
56 | AC_CHECK_LIB(com_err, com_err) |
---|
57 | AC_CHECK_LIB(nsl, gethostbyname) |
---|
58 | AC_CHECK_LIB(socket, socket) |
---|
59 | dnl AC_CHECK_LIB(des425, req_act_vno) |
---|
60 | AC_CHECK_LIB(des425, des_cbc_encrypt) |
---|
61 | AC_CHECK_LIB(resolv, res_search) |
---|
62 | dnl AC_CHECK_LIB(zephyr, ZGetSender,, AC_MSG_ERROR(No zephyr library found.)) |
---|
63 | AC_CHECK_LIB(zephyr, ZGetSender) |
---|
64 | AC_CHECK_LIB(zephyr, ZInitLocationInfo, AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [], [Have ZInitLocationInfo]),) |
---|
65 | |
---|
66 | AC_ARG_ENABLE([athstatic], AS_HELP_STRING([--enable-athstatic], |
---|
67 | [Statically link libraries in /usr/athena/lib]), |
---|
68 | [ATHSTATIC=./athstatic], |
---|
69 | [ATHSTATIC=]) |
---|
70 | |
---|
71 | AC_CHECK_FUNCS(use_default_colors resizeterm des_string_to_key des_key_sched des_ecb_encrypt) |
---|
72 | |
---|
73 | AC_MSG_CHECKING(for des_ecb_encrypt prototype) |
---|
74 | AC_TRY_COMPILE([#include <des.h> |
---|
75 | int des_ecb_encrypt(char foo[], char bar[], des_key_schedule baz, int qux);], |
---|
76 | [int foo = des_ecb_encrypt(0,0,0,0);], |
---|
77 | ac_cv_des_ecb_encrypt_proto=no, |
---|
78 | ac_cv_des_ecb_encrypt_proto=yes) |
---|
79 | AC_MSG_RESULT($ac_cv_des_ecb_encrypt_proto) |
---|
80 | if test "$ac_cv_des_ecb_encrypt_proto" = yes; then |
---|
81 | AC_DEFINE([HAVE_DES_ECB_ENCRYPT_PROTO], [], [have proto for des_ecb_encrypt]) |
---|
82 | fi |
---|
83 | |
---|
84 | dnl Checks for header files. |
---|
85 | AC_HEADER_STDC |
---|
86 | AC_HEADER_SYS_WAIT |
---|
87 | AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd.h com_err.h) |
---|
88 | |
---|
89 | dnl Add CFLAGS for embeded perl |
---|
90 | FOO=`perl -MExtUtils::Embed -e ccopts` |
---|
91 | echo Adding perl CFLAGS ${FOO} |
---|
92 | CFLAGS=${CFLAGS}\ ${FOO} |
---|
93 | |
---|
94 | dnl Find the location of perl XSUBPP |
---|
95 | AC_MSG_CHECKING(for the perl xsubpp precompiler) |
---|
96 | XSUBPPDIR="`(perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;') | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`" |
---|
97 | if test -n "${XSUBPPDIR}"; then |
---|
98 | AC_MSG_RESULT(${XSUBPPDIR}) |
---|
99 | else |
---|
100 | AC_MSG_ERROR(not found) |
---|
101 | fi |
---|
102 | |
---|
103 | if test -f "${XSUBPPDIR}/typemap"; then |
---|
104 | XSUBPPFLAGS="-typemap ${XSUBPPDIR}/typemap" |
---|
105 | else |
---|
106 | XSUBPPFLAGS="" |
---|
107 | fi |
---|
108 | |
---|
109 | dnl Add LDFLAGS for embedded perl |
---|
110 | FOO=`perl -MExtUtils::Embed -e ldopts` |
---|
111 | echo Adding perl LDFLAGS ${FOO} |
---|
112 | LDFLAGS=${LDFLAGS}\ ${FOO} |
---|
113 | |
---|
114 | dnl Add CFLAGS and LDFLAGS for glib-2.0 |
---|
115 | PKG_CHECK_MODULES(GLIB,glib-2.0) |
---|
116 | |
---|
117 | echo Adding glib-2.0 CFLAGS ${GLIB_CFLAGS} |
---|
118 | CFLAGS="${GLIB_CFLAGS} ${CFLAGS}" |
---|
119 | echo Adding glib-2.0 LDFLAGS ${GLIB_LIBS} |
---|
120 | LDFLAGS="${GLIB_LIBS} ${LDFLAGS}" |
---|
121 | |
---|
122 | |
---|
123 | dnl Checks for typedefs, structures, and compiler characteristics. |
---|
124 | |
---|
125 | AC_SUBST(XSUBPPDIR) |
---|
126 | AC_SUBST(XSUBPPFLAGS) |
---|
127 | AC_SUBST(ATHSTATIC) |
---|
128 | |
---|
129 | AC_PROG_INSTALL |
---|
130 | |
---|
131 | AC_CONFIG_SUBDIRS(libfaim) |
---|
132 | |
---|
133 | AC_OUTPUT(Makefile) |
---|