| 1 | dnl $Id$ |
|---|
| 2 | dnl Process this file with autoconf to produce a configure script. |
|---|
| 3 | AC_INIT([BarnOwl],[1.1.2],[bug-barnowl@mit.edu]) |
|---|
| 4 | AM_INIT_AUTOMAKE([-Wall foreign]) |
|---|
| 5 | |
|---|
| 6 | AC_CONFIG_HEADER([config.h]) |
|---|
| 7 | |
|---|
| 8 | AC_PROG_CC |
|---|
| 9 | |
|---|
| 10 | dnl Check for Athena |
|---|
| 11 | AC_MSG_CHECKING(for /usr/athena/include) |
|---|
| 12 | if test -d /usr/athena/include; then |
|---|
| 13 | CFLAGS=${CFLAGS}\ -I/usr/athena/include |
|---|
| 14 | CPPFLAGS=${CPPFLAGS}\ -I/usr/athena/include |
|---|
| 15 | AC_MSG_RESULT(yes) |
|---|
| 16 | else |
|---|
| 17 | AC_MSG_RESULT(no) |
|---|
| 18 | fi |
|---|
| 19 | AC_MSG_CHECKING(for /usr/athena/lib) |
|---|
| 20 | if test -d /usr/athena/lib; then |
|---|
| 21 | LDFLAGS=${LDFLAGS}\ -L/usr/athena/lib |
|---|
| 22 | AC_MSG_RESULT(yes) |
|---|
| 23 | else |
|---|
| 24 | AC_MSG_RESULT(no) |
|---|
| 25 | fi |
|---|
| 26 | |
|---|
| 27 | dnl Check for kerberosIV include |
|---|
| 28 | AC_MSG_CHECKING(for kerberosIV) |
|---|
| 29 | if test -d /usr/include/kerberosIV; then |
|---|
| 30 | CFLAGS=${CFLAGS}\ -I/usr/include/kerberosIV |
|---|
| 31 | CPPFLAGS=${CPPFLAGS}\ -I/usr/include/kerberosIV |
|---|
| 32 | AC_MSG_RESULT(yes) |
|---|
| 33 | elif test -d /usr/local/include/kerberosIV; then |
|---|
| 34 | CFLAGS=${CFLAGS}\ -I/usr/local/include/kerberosIV |
|---|
| 35 | CPPFLAGS=${CPPFLAGS}\ -I/usr/local/include/kerberosIV |
|---|
| 36 | AC_MSG_RESULT(yes) |
|---|
| 37 | elif test -d /usr/include/openssl; then |
|---|
| 38 | CFLAGS=${CFLAGS}\ -I/usr/include/openssl |
|---|
| 39 | CPPFLAGS=${CPPFLAGS}\ -I/usr/include/openssl |
|---|
| 40 | AC_MSG_RESULT(OpenSSL DES found instead) |
|---|
| 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,,AC_CHECK_LIB(crypto,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_CHECK_FUNCS(use_default_colors resizeterm des_string_to_key des_key_sched des_ecb_encrypt) |
|---|
| 67 | AC_CHECK_FUNCS( DES_string_to_key DES_ecb_encrypt DES_key_sched) |
|---|
| 68 | |
|---|
| 69 | AC_MSG_CHECKING(for des_ecb_encrypt prototype) |
|---|
| 70 | AC_TRY_COMPILE([#include <des.h> |
|---|
| 71 | int des_ecb_encrypt(char foo[], char bar[], des_key_schedule baz, int qux);], |
|---|
| 72 | [int foo = des_ecb_encrypt(0,0,0,0);], |
|---|
| 73 | ac_cv_des_ecb_encrypt_proto=no, |
|---|
| 74 | ac_cv_des_ecb_encrypt_proto=yes) |
|---|
| 75 | AC_MSG_RESULT($ac_cv_des_ecb_encrypt_proto) |
|---|
| 76 | if test "$ac_cv_des_ecb_encrypt_proto" = yes; then |
|---|
| 77 | AC_DEFINE([HAVE_DES_ECB_ENCRYPT_PROTO], [], [have proto for des_ecb_encrypt]) |
|---|
| 78 | fi |
|---|
| 79 | |
|---|
| 80 | dnl Checks for header files. |
|---|
| 81 | AC_HEADER_STDC |
|---|
| 82 | AC_HEADER_SYS_WAIT |
|---|
| 83 | AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd.h com_err.h) |
|---|
| 84 | |
|---|
| 85 | dnl Add CFLAGS for embeded perl |
|---|
| 86 | FOO=`perl -MExtUtils::Embed -e ccopts` |
|---|
| 87 | AC_MSG_NOTICE([Adding perl CFLAGS ${FOO}]) |
|---|
| 88 | CFLAGS=${CFLAGS}\ ${FOO} |
|---|
| 89 | |
|---|
| 90 | dnl Find the location of perl XSUBPP |
|---|
| 91 | AC_MSG_CHECKING(for the perl xsubpp precompiler) |
|---|
| 92 | XSUBPPDIR="`(perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;') | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`" |
|---|
| 93 | if test -n "${XSUBPPDIR}"; then |
|---|
| 94 | AC_MSG_RESULT(${XSUBPPDIR}) |
|---|
| 95 | else |
|---|
| 96 | AC_MSG_ERROR(not found) |
|---|
| 97 | fi |
|---|
| 98 | |
|---|
| 99 | if test -f "${XSUBPPDIR}/typemap"; then |
|---|
| 100 | XSUBPPFLAGS="-typemap ${XSUBPPDIR}/typemap" |
|---|
| 101 | else |
|---|
| 102 | XSUBPPFLAGS="" |
|---|
| 103 | fi |
|---|
| 104 | |
|---|
| 105 | dnl Add LDFLAGS for embedded perl |
|---|
| 106 | FOO=`perl -MExtUtils::Embed -e ldopts` |
|---|
| 107 | AC_MSG_NOTICE([Adding perl LIBS ${FOO}]) |
|---|
| 108 | LIBS=${LIBS}\ ${FOO} |
|---|
| 109 | |
|---|
| 110 | dnl Add CFLAGS and LDFLAGS for glib-2.0 |
|---|
| 111 | PKG_CHECK_MODULES(GLIB,glib-2.0) |
|---|
| 112 | |
|---|
| 113 | AC_MSG_NOTICE([Adding glib-2.0 CFLAGS ${GLIB_CFLAGS}]) |
|---|
| 114 | CFLAGS="${GLIB_CFLAGS} ${CFLAGS}" |
|---|
| 115 | AC_MSG_NOTICE([Adding glib-2.0 LDFLAGS ${GLIB_LIBS}]) |
|---|
| 116 | LDFLAGS="${GLIB_LIBS} ${LDFLAGS}" |
|---|
| 117 | |
|---|
| 118 | if test "x${prefix}" = "xNONE"; then |
|---|
| 119 | prefix="${ac_default_prefix}" |
|---|
| 120 | fi |
|---|
| 121 | |
|---|
| 122 | AC_DEFINE_UNQUOTED([DATADIR],["${prefix}/share/${PACKAGE}"], |
|---|
| 123 | [Package data directory]) |
|---|
| 124 | |
|---|
| 125 | dnl Checks for typedefs, structures, and compiler characteristics. |
|---|
| 126 | |
|---|
| 127 | AC_SUBST(XSUBPPDIR) |
|---|
| 128 | AC_SUBST(XSUBPPFLAGS) |
|---|
| 129 | |
|---|
| 130 | AC_PROG_INSTALL |
|---|
| 131 | AC_PROG_RANLIB |
|---|
| 132 | |
|---|
| 133 | AC_CONFIG_FILES([Makefile libfaim/Makefile]) |
|---|
| 134 | AC_OUTPUT([perl/modules/Makefile]) |
|---|