| 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 | |
|---|
| 15 | dnl Check for Athena |
|---|
| 16 | AC_MSG_CHECKING(for /usr/athena/include) |
|---|
| 17 | if test -d /usr/athena/include; then |
|---|
| 18 | CFLAGS=${CFLAGS}\ -I/usr/athena/include |
|---|
| 19 | CPPFLAGS=${CPPFLAGS}\ -I/usr/athena/include |
|---|
| 20 | AC_MSG_RESULT(yes) |
|---|
| 21 | else |
|---|
| 22 | AC_MSG_RESULT(no) |
|---|
| 23 | fi |
|---|
| 24 | AC_MSG_CHECKING(for /usr/athena/lib) |
|---|
| 25 | if test -d /usr/athena/lib; then |
|---|
| 26 | LDFLAGS=-L/usr/athena/lib\ ${LDFLAGS} |
|---|
| 27 | AC_MSG_RESULT(yes) |
|---|
| 28 | else |
|---|
| 29 | AC_MSG_RESULT(no) |
|---|
| 30 | fi |
|---|
| 31 | |
|---|
| 32 | dnl Check for kerberosIV include |
|---|
| 33 | AC_MSG_CHECKING(for /usr/include/kerberosIV) |
|---|
| 34 | if test -d /usr/include/kerberosIV; then |
|---|
| 35 | CFLAGS=${CFLAGS}\ -I/usr/include/kerberosIV |
|---|
| 36 | CPPFLAGS=${CPPFLAGS}\ -I/usr/include/kerberosIV |
|---|
| 37 | AC_MSG_RESULT(yes) |
|---|
| 38 | else |
|---|
| 39 | AC_MSG_RESULT(no) |
|---|
| 40 | fi |
|---|
| 41 | |
|---|
| 42 | AC_CHECK_LIB(ncurses, initscr,, |
|---|
| 43 | AC_CHECK_LIB(curses, initscr,, AC_MSG_ERROR(No curses library found.))) |
|---|
| 44 | AC_CHECK_LIB(com_err, com_err) |
|---|
| 45 | AC_CHECK_LIB(nsl, gethostbyname) |
|---|
| 46 | AC_CHECK_LIB(socket, socket) |
|---|
| 47 | AC_CHECK_LIB(k5crypto, krb5_derive_key) |
|---|
| 48 | dnl AC_CHECK_LIB(des425, req_act_vno) |
|---|
| 49 | AC_CHECK_LIB(des425, des_cbc_encrypt) |
|---|
| 50 | AC_CHECK_LIB(resolv, res_search) |
|---|
| 51 | AC_CHECK_LIB(krb5, krb5_get_credentials) |
|---|
| 52 | AC_CHECK_LIB(krb4, krb_sendauth,, |
|---|
| 53 | AC_CHECK_LIB(krb, krb_sendauth)) |
|---|
| 54 | dnl AC_CHECK_LIB(zephyr, ZGetSender,, AC_MSG_ERROR(No zephyr library found.)) |
|---|
| 55 | AC_CHECK_LIB(zephyr, ZGetSender) |
|---|
| 56 | AC_CHECK_LIB(zephyr, ZInitLocationInfo, AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [], [Have ZInitLocationInfo]),) |
|---|
| 57 | |
|---|
| 58 | AC_CHECK_FUNCS(use_default_colors resizeterm des_string_to_key des_key_sched des_ecb_encrypt) |
|---|
| 59 | |
|---|
| 60 | AC_MSG_CHECKING(for des_ecb_encrypt prototype) |
|---|
| 61 | AC_TRY_COMPILE([#include <des.h> |
|---|
| 62 | int des_ecb_encrypt(char foo[], char bar[], des_key_schedule baz, int qux);], |
|---|
| 63 | [int foo = des_ecb_encrypt(0,0,0,0);], |
|---|
| 64 | ac_cv_des_ecb_encrypt_proto=no, |
|---|
| 65 | ac_cv_des_ecb_encrypt_proto=yes) |
|---|
| 66 | AC_MSG_RESULT($ac_cv_des_ecb_encrypt_proto) |
|---|
| 67 | if test "$ac_cv_des_ecb_encrypt_proto" = yes; then |
|---|
| 68 | AC_DEFINE([HAVE_DES_ECB_ENCRYPT_PROTO], [], [have proto for des_ecb_encrypt]) |
|---|
| 69 | fi |
|---|
| 70 | |
|---|
| 71 | dnl Checks for header files. |
|---|
| 72 | AC_HEADER_STDC |
|---|
| 73 | AC_HEADER_SYS_WAIT |
|---|
| 74 | AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd.h com_err.h) |
|---|
| 75 | |
|---|
| 76 | dnl Add CFLAGS for embeded perl |
|---|
| 77 | FOO=`perl -MExtUtils::Embed -e ccopts` |
|---|
| 78 | echo Adding perl CFLAGS ${FOO} |
|---|
| 79 | CFLAGS=${CFLAGS}\ ${FOO} |
|---|
| 80 | |
|---|
| 81 | dnl Find the location of perl XSUBPP |
|---|
| 82 | AC_MSG_CHECKING(for the perl xsubpp precompiler) |
|---|
| 83 | XSUBPPDIR="`(perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;') | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`" |
|---|
| 84 | if test -n "${XSUBPPDIR}"; then |
|---|
| 85 | AC_MSG_RESULT(${XSUBPPDIR}) |
|---|
| 86 | else |
|---|
| 87 | AC_MSG_ERROR(not found) |
|---|
| 88 | fi |
|---|
| 89 | |
|---|
| 90 | if test -f "${XSUBPPDIR}/typemap"; then |
|---|
| 91 | XSUBPPFLAGS="-typemap ${XSUBPPDIR}/typemap" |
|---|
| 92 | else |
|---|
| 93 | XSUBPPFLAGS="" |
|---|
| 94 | fi |
|---|
| 95 | |
|---|
| 96 | dnl Add LDFLAGS for embeded perl |
|---|
| 97 | FOO=`perl -MExtUtils::Embed -e ldopts` |
|---|
| 98 | echo Adding perl LDFLAGS ${FOO} |
|---|
| 99 | LDFLAGS=${LDFLAGS}\ ${FOO} |
|---|
| 100 | |
|---|
| 101 | dnl Checks for typedefs, structures, and compiler characteristics. |
|---|
| 102 | AC_CHECK_FILE(/usr/share/terminfo, AC_DEFINE(TERMINFO, "/usr/share/terminfo", [Have terminfo]), |
|---|
| 103 | AC_CHECK_FILE(/usr/share/lib/terminfo, AC_DEFINE(TERMINFO, "/usr/share/lib/terminfo", [Have terminfo]), |
|---|
| 104 | AC_MSG_ERROR(No terminfo found for this system))) |
|---|
| 105 | |
|---|
| 106 | AC_SUBST(XSUBPPDIR) |
|---|
| 107 | AC_SUBST(XSUBPPFLAGS) |
|---|
| 108 | |
|---|
| 109 | AC_PROG_INSTALL |
|---|
| 110 | |
|---|
| 111 | AC_CONFIG_SUBDIRS(libfaim) |
|---|
| 112 | |
|---|
| 113 | AC_OUTPUT(Makefile) |
|---|