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