| 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 | elif 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) |
|---|
| 45 | else |
|---|
| 46 | AC_MSG_RESULT(no) |
|---|
| 47 | fi |
|---|
| 48 | |
|---|
| 49 | AC_ARG_WITH([stack-protector], |
|---|
| 50 | [AS_HELP_STRING([--with-stack-protector], |
|---|
| 51 | [Enable gcc -fstack-protector])], |
|---|
| 52 | [], |
|---|
| 53 | [with_stack_protector=check]) |
|---|
| 54 | |
|---|
| 55 | AS_IF([test "x$with_stack_protector" != xno], |
|---|
| 56 | [ |
|---|
| 57 | SAVE_CFLAGS=$CFLAGS |
|---|
| 58 | CFLAGS="$CFLAGS -fstack-protector" |
|---|
| 59 | AC_MSG_CHECKING(whether protection cflags work) |
|---|
| 60 | AC_COMPILE_IFELSE(int i;, |
|---|
| 61 | [AC_MSG_RESULT(yes)], |
|---|
| 62 | [AC_MSG_RESULT(no) |
|---|
| 63 | CFLAGS=$SAVE_CFLAGS |
|---|
| 64 | if test "x$with_stack_protector" != xcheck; then |
|---|
| 65 | AC_MSG_FAILURE([--with-stack-protector selected, but gcc does support it.]) |
|---|
| 66 | fi]) |
|---|
| 67 | AC_CHECK_LIB(ssp, __stack_chk_guard) |
|---|
| 68 | ]) |
|---|
| 69 | |
|---|
| 70 | AC_CHECK_LIB(ncursesw, initscr,, AC_MSG_ERROR(No libncursesw found.)) |
|---|
| 71 | AC_CHECK_LIB(com_err, com_err) |
|---|
| 72 | AC_CHECK_LIB(nsl, gethostbyname) |
|---|
| 73 | AC_CHECK_LIB(socket, socket) |
|---|
| 74 | dnl AC_CHECK_LIB(des425, req_act_vno) |
|---|
| 75 | AC_CHECK_LIB(des425, des_cbc_encrypt,,AC_CHECK_LIB(crypto,DES_cbc_encrypt)) |
|---|
| 76 | AC_CHECK_LIB(resolv, res_search) |
|---|
| 77 | |
|---|
| 78 | AC_ARG_WITH([zephyr], |
|---|
| 79 | [AS_HELP_STRING([--with-libzephyr], |
|---|
| 80 | [Disable Zephyr support])], |
|---|
| 81 | [], |
|---|
| 82 | [with_zephyr=check]) |
|---|
| 83 | |
|---|
| 84 | AS_IF([test "x$with_zephyr" != xno], |
|---|
| 85 | [AC_CHECK_LIB([zephyr], [ZGetSender], |
|---|
| 86 | [LIBS="$LIBS -lzephyr" |
|---|
| 87 | AC_DEFINE([HAVE_LIBZEPHYR], [1], |
|---|
| 88 | [Define if you have libzephyr]) |
|---|
| 89 | AC_CHECK_LIB([zephyr], [ZInitLocationInfo], |
|---|
| 90 | AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [1], |
|---|
| 91 | [Have ZInitLocationInfo]),) |
|---|
| 92 | ], |
|---|
| 93 | [if test "x$with_zephyr" != xcheck; then |
|---|
| 94 | AC_MSG_FAILURE( |
|---|
| 95 | [--with-libzephyr was given, but libzephyr does not seem to be available.]) |
|---|
| 96 | fi |
|---|
| 97 | ])]) |
|---|
| 98 | |
|---|
| 99 | AC_ARG_ENABLE([athstatic], AS_HELP_STRING([--enable-athstatic], |
|---|
| 100 | [Statically link libraries in /usr/athena/lib]), |
|---|
| 101 | [ATHSTATIC=./athstatic], |
|---|
| 102 | [ATHSTATIC=]) |
|---|
| 103 | |
|---|
| 104 | AC_CHECK_FUNCS(use_default_colors resizeterm des_string_to_key des_key_sched des_ecb_encrypt) |
|---|
| 105 | AC_CHECK_FUNCS( DES_string_to_key DES_ecb_encrypt DES_key_sched) |
|---|
| 106 | |
|---|
| 107 | AC_MSG_CHECKING(for des_ecb_encrypt prototype) |
|---|
| 108 | AC_TRY_COMPILE([#include <des.h> |
|---|
| 109 | int des_ecb_encrypt(char foo[], char bar[], des_key_schedule baz, int qux);], |
|---|
| 110 | [int foo = des_ecb_encrypt(0,0,0,0);], |
|---|
| 111 | ac_cv_des_ecb_encrypt_proto=no, |
|---|
| 112 | ac_cv_des_ecb_encrypt_proto=yes) |
|---|
| 113 | AC_MSG_RESULT($ac_cv_des_ecb_encrypt_proto) |
|---|
| 114 | if test "$ac_cv_des_ecb_encrypt_proto" = yes; then |
|---|
| 115 | AC_DEFINE([HAVE_DES_ECB_ENCRYPT_PROTO], [], [have proto for des_ecb_encrypt]) |
|---|
| 116 | fi |
|---|
| 117 | |
|---|
| 118 | dnl Checks for header files. |
|---|
| 119 | AC_HEADER_STDC |
|---|
| 120 | AC_HEADER_SYS_WAIT |
|---|
| 121 | AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd.h com_err.h) |
|---|
| 122 | |
|---|
| 123 | dnl Add CFLAGS for embeded perl |
|---|
| 124 | FOO=`perl -MExtUtils::Embed -e ccopts` |
|---|
| 125 | AC_MSG_NOTICE([Adding perl CFLAGS ${FOO}]) |
|---|
| 126 | CFLAGS=${CFLAGS}\ ${FOO} |
|---|
| 127 | |
|---|
| 128 | dnl Find the location of perl XSUBPP |
|---|
| 129 | AC_MSG_CHECKING(for the perl xsubpp precompiler) |
|---|
| 130 | XSUBPPDIR="`(perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;') | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`" |
|---|
| 131 | if test -n "${XSUBPPDIR}"; then |
|---|
| 132 | AC_MSG_RESULT(${XSUBPPDIR}) |
|---|
| 133 | else |
|---|
| 134 | AC_MSG_ERROR(not found) |
|---|
| 135 | fi |
|---|
| 136 | |
|---|
| 137 | if test -f "${XSUBPPDIR}/typemap"; then |
|---|
| 138 | XSUBPPFLAGS="-typemap ${XSUBPPDIR}/typemap" |
|---|
| 139 | else |
|---|
| 140 | XSUBPPFLAGS="" |
|---|
| 141 | fi |
|---|
| 142 | |
|---|
| 143 | dnl Add LDFLAGS for embedded perl |
|---|
| 144 | FOO=`perl -MExtUtils::Embed -e ldopts` |
|---|
| 145 | AC_MSG_NOTICE([Adding perl LDFLAGS ${FOO}]) |
|---|
| 146 | LDFLAGS=${LDFLAGS}\ ${FOO} |
|---|
| 147 | |
|---|
| 148 | dnl Add CFLAGS and LDFLAGS for glib-2.0 |
|---|
| 149 | PKG_CHECK_MODULES(GLIB,glib-2.0) |
|---|
| 150 | |
|---|
| 151 | AC_MSG_NOTICE([Adding glib-2.0 CFLAGS ${GLIB_CFLAGS}]) |
|---|
| 152 | CFLAGS="${GLIB_CFLAGS} ${CFLAGS}" |
|---|
| 153 | AC_MSG_NOTICE([Adding glib-2.0 LDFLAGS ${GLIB_LIBS}]) |
|---|
| 154 | LDFLAGS="${GLIB_LIBS} ${LDFLAGS}" |
|---|
| 155 | |
|---|
| 156 | dnl Checks for typedefs, structures, and compiler characteristics. |
|---|
| 157 | |
|---|
| 158 | dnl Support --program-{prefix,suffix,transform} |
|---|
| 159 | AC_ARG_PROGRAM |
|---|
| 160 | |
|---|
| 161 | AC_SUBST(XSUBPPDIR) |
|---|
| 162 | AC_SUBST(XSUBPPFLAGS) |
|---|
| 163 | AC_SUBST(ATHSTATIC) |
|---|
| 164 | |
|---|
| 165 | AC_PROG_INSTALL |
|---|
| 166 | |
|---|
| 167 | AC_CONFIG_SUBDIRS(libfaim) |
|---|
| 168 | |
|---|
| 169 | AC_OUTPUT(Makefile) |
|---|