[1aee7d9] | 1 | dnl $Id$ |
---|
[7d4fbcd] | 2 | dnl Process this file with autoconf to produce a configure script. |
---|
[b00c0a1] | 3 | AC_INIT([BarnOwl],[1.3pre2],[bug-barnowl@mit.edu]) |
---|
[37f27bc] | 4 | AM_INIT_AUTOMAKE([-Wall foreign]) |
---|
[7d4fbcd] | 5 | |
---|
[37f27bc] | 6 | AC_CONFIG_HEADER([config.h]) |
---|
[7d4fbcd] | 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 |
---|
[e6449bc] | 14 | CPPFLAGS=${CPPFLAGS}\ -I/usr/athena/include |
---|
[7d4fbcd] | 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 |
---|
[1d7e094] | 21 | LDFLAGS=${LDFLAGS}\ -L/usr/athena/lib |
---|
[7d4fbcd] | 22 | AC_MSG_RESULT(yes) |
---|
| 23 | else |
---|
| 24 | AC_MSG_RESULT(no) |
---|
| 25 | fi |
---|
| 26 | |
---|
[fe39450] | 27 | dnl Check for kerberosIV include |
---|
[18e28a4] | 28 | AC_MSG_CHECKING(for kerberosIV) |
---|
[fe39450] | 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) |
---|
[18e28a4] | 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) |
---|
[b5fe6d2] | 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) |
---|
[fe39450] | 41 | else |
---|
| 42 | AC_MSG_RESULT(no) |
---|
| 43 | fi |
---|
| 44 | |
---|
[4097723] | 45 | AC_ARG_WITH([stack-protector], |
---|
| 46 | [AS_HELP_STRING([--with-stack-protector], |
---|
| 47 | [Enable gcc -fstack-protector])], |
---|
| 48 | [], |
---|
| 49 | [with_stack_protector=check]) |
---|
| 50 | |
---|
| 51 | AS_IF([test "x$with_stack_protector" != xno], |
---|
| 52 | [ |
---|
| 53 | SAVE_CFLAGS=$CFLAGS |
---|
| 54 | CFLAGS="$CFLAGS -fstack-protector" |
---|
| 55 | AC_MSG_CHECKING(whether protection cflags work) |
---|
| 56 | AC_COMPILE_IFELSE(int i;, |
---|
| 57 | [AC_MSG_RESULT(yes)], |
---|
| 58 | [AC_MSG_RESULT(no) |
---|
| 59 | CFLAGS=$SAVE_CFLAGS |
---|
| 60 | if test "x$with_stack_protector" != xcheck; then |
---|
| 61 | AC_MSG_FAILURE([--with-stack-protector selected, but gcc does support it.]) |
---|
| 62 | fi]) |
---|
| 63 | AC_CHECK_LIB(ssp, __stack_chk_guard) |
---|
| 64 | ]) |
---|
[87afe92] | 65 | |
---|
[d54035d] | 66 | AC_CHECK_LIB(ncursesw, initscr,, AC_MSG_ERROR(No libncursesw found.)) |
---|
[7d4fbcd] | 67 | AC_CHECK_LIB(com_err, com_err) |
---|
| 68 | AC_CHECK_LIB(nsl, gethostbyname) |
---|
| 69 | AC_CHECK_LIB(socket, socket) |
---|
[8298425] | 70 | dnl AC_CHECK_LIB(des425, req_act_vno) |
---|
[b5fe6d2] | 71 | AC_CHECK_LIB(des425, des_cbc_encrypt,,AC_CHECK_LIB(crypto,DES_cbc_encrypt)) |
---|
[d09e5a1] | 72 | AC_CHECK_LIB(resolv, res_search) |
---|
[2c270e6] | 73 | |
---|
| 74 | AC_ARG_WITH([zephyr], |
---|
| 75 | [AS_HELP_STRING([--with-libzephyr], |
---|
| 76 | [Disable Zephyr support])], |
---|
| 77 | [], |
---|
| 78 | [with_zephyr=check]) |
---|
| 79 | |
---|
| 80 | AS_IF([test "x$with_zephyr" != xno], |
---|
| 81 | [AC_CHECK_LIB([zephyr], [ZGetSender], |
---|
[16c0416] | 82 | [LIBS="$LIBS -lzephyr" |
---|
| 83 | AC_DEFINE([HAVE_LIBZEPHYR], [1], |
---|
[2c270e6] | 84 | [Define if you have libzephyr]) |
---|
| 85 | AC_CHECK_LIB([zephyr], [ZInitLocationInfo], |
---|
| 86 | AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [1], |
---|
| 87 | [Have ZInitLocationInfo]),) |
---|
| 88 | ], |
---|
| 89 | [if test "x$with_zephyr" != xcheck; then |
---|
| 90 | AC_MSG_FAILURE( |
---|
| 91 | [--with-libzephyr was given, but libzephyr does not seem to be available.]) |
---|
| 92 | fi |
---|
| 93 | ])]) |
---|
[ac70242] | 94 | |
---|
[dc2ad79] | 95 | AC_CHECK_FUNCS(use_default_colors resizeterm des_string_to_key des_key_sched des_ecb_encrypt) |
---|
[b5fe6d2] | 96 | AC_CHECK_FUNCS( DES_string_to_key DES_ecb_encrypt DES_key_sched) |
---|
[e51b410] | 97 | |
---|
[ac70242] | 98 | AC_MSG_CHECKING(for des_ecb_encrypt prototype) |
---|
| 99 | AC_TRY_COMPILE([#include <des.h> |
---|
| 100 | int des_ecb_encrypt(char foo[], char bar[], des_key_schedule baz, int qux);], |
---|
| 101 | [int foo = des_ecb_encrypt(0,0,0,0);], |
---|
| 102 | ac_cv_des_ecb_encrypt_proto=no, |
---|
| 103 | ac_cv_des_ecb_encrypt_proto=yes) |
---|
| 104 | AC_MSG_RESULT($ac_cv_des_ecb_encrypt_proto) |
---|
| 105 | if test "$ac_cv_des_ecb_encrypt_proto" = yes; then |
---|
| 106 | AC_DEFINE([HAVE_DES_ECB_ENCRYPT_PROTO], [], [have proto for des_ecb_encrypt]) |
---|
| 107 | fi |
---|
[7d4fbcd] | 108 | |
---|
| 109 | dnl Checks for header files. |
---|
| 110 | AC_HEADER_STDC |
---|
| 111 | AC_HEADER_SYS_WAIT |
---|
[e8b95f8] | 112 | AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd.h com_err.h) |
---|
[7d4fbcd] | 113 | |
---|
| 114 | dnl Add CFLAGS for embeded perl |
---|
| 115 | FOO=`perl -MExtUtils::Embed -e ccopts` |
---|
[7c09b21] | 116 | AC_MSG_NOTICE([Adding perl CFLAGS ${FOO}]) |
---|
[7d4fbcd] | 117 | CFLAGS=${CFLAGS}\ ${FOO} |
---|
| 118 | |
---|
[e51b410] | 119 | dnl Find the location of perl XSUBPP |
---|
[8ee73f8d] | 120 | AC_MSG_CHECKING(for the perl xsubpp precompiler) |
---|
[6794f72] | 121 | XSUBPPDIR="`(perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;') | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`" |
---|
[8ee73f8d] | 122 | if test -n "${XSUBPPDIR}"; then |
---|
| 123 | AC_MSG_RESULT(${XSUBPPDIR}) |
---|
| 124 | else |
---|
| 125 | AC_MSG_ERROR(not found) |
---|
| 126 | fi |
---|
| 127 | |
---|
[4ad3480] | 128 | if test -f "${XSUBPPDIR}/typemap"; then |
---|
| 129 | XSUBPPFLAGS="-typemap ${XSUBPPDIR}/typemap" |
---|
| 130 | else |
---|
| 131 | XSUBPPFLAGS="" |
---|
| 132 | fi |
---|
| 133 | |
---|
[18e28a4] | 134 | dnl Add LDFLAGS for embedded perl |
---|
[3f21b8e] | 135 | FOO=`perl -MExtUtils::Embed -e ldopts` |
---|
[c08a725] | 136 | AC_MSG_NOTICE([Adding perl LIBS ${FOO}]) |
---|
| 137 | LIBS=${LIBS}\ ${FOO} |
---|
[7d4fbcd] | 138 | |
---|
[34509d5] | 139 | dnl Add CFLAGS and LDFLAGS for glib-2.0 |
---|
| 140 | PKG_CHECK_MODULES(GLIB,glib-2.0) |
---|
| 141 | |
---|
[7c09b21] | 142 | AC_MSG_NOTICE([Adding glib-2.0 CFLAGS ${GLIB_CFLAGS}]) |
---|
[d9337637] | 143 | CFLAGS="${GLIB_CFLAGS} ${CFLAGS}" |
---|
[7c09b21] | 144 | AC_MSG_NOTICE([Adding glib-2.0 LDFLAGS ${GLIB_LIBS}]) |
---|
[d9337637] | 145 | LDFLAGS="${GLIB_LIBS} ${LDFLAGS}" |
---|
[34509d5] | 146 | |
---|
[37f27bc] | 147 | if test "x${prefix}" = "xNONE"; then |
---|
| 148 | prefix="${ac_default_prefix}" |
---|
| 149 | fi |
---|
[7d4fbcd] | 150 | |
---|
[37f27bc] | 151 | AC_DEFINE_UNQUOTED([DATADIR],["${prefix}/share/${PACKAGE}"], |
---|
| 152 | [Package data directory]) |
---|
[7d4fbcd] | 153 | |
---|
[37f27bc] | 154 | dnl Checks for typedefs, structures, and compiler characteristics. |
---|
[c50f589] | 155 | |
---|
[15bd5ef] | 156 | AC_SUBST(XSUBPPDIR) |
---|
[4ad3480] | 157 | AC_SUBST(XSUBPPFLAGS) |
---|
[8ee73f8d] | 158 | |
---|
[ac70242] | 159 | AC_PROG_INSTALL |
---|
[37f27bc] | 160 | AC_PROG_RANLIB |
---|
[ac70242] | 161 | |
---|
[37f27bc] | 162 | AC_CONFIG_FILES([Makefile libfaim/Makefile]) |
---|
| 163 | AC_OUTPUT([perl/modules/Makefile]) |
---|