| 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 | PROTECT_CFLAGS=${PROTECT_CFLAGS-"-fstack-protector"} |
|---|
| 49 | SAVE_CFLAGS=$CFLAGS |
|---|
| 50 | CFLAGS="$CFLAGS $PROTECT_CFLAGS" |
|---|
| 51 | AC_MSG_CHECKING(whether protection cflags work) |
|---|
| 52 | AC_COMPILE_IFELSE(int i;, |
|---|
| 53 | [AC_MSG_RESULT(yes)], |
|---|
| 54 | [AC_MSG_RESULT(no) |
|---|
| 55 | CFLAGS=$SAVE_CFLAGS]) |
|---|
| 56 | |
|---|
| 57 | |
|---|
| 58 | AC_CHECK_LIB(ssp, __stack_chk_guard) |
|---|
| 59 | AC_CHECK_LIB(ncursesw, initscr,, AC_MSG_ERROR(No libncursesw found.)) |
|---|
| 60 | AC_CHECK_LIB(com_err, com_err) |
|---|
| 61 | AC_CHECK_LIB(nsl, gethostbyname) |
|---|
| 62 | AC_CHECK_LIB(socket, socket) |
|---|
| 63 | dnl AC_CHECK_LIB(des425, req_act_vno) |
|---|
| 64 | AC_CHECK_LIB(des425, des_cbc_encrypt,,AC_CHECK_LIB(crypto,DES_cbc_encrypt)) |
|---|
| 65 | AC_CHECK_LIB(resolv, res_search) |
|---|
| 66 | dnl AC_CHECK_LIB(zephyr, ZGetSender,, AC_MSG_ERROR(No zephyr library found.)) |
|---|
| 67 | AC_CHECK_LIB(zephyr, ZGetSender) |
|---|
| 68 | AC_CHECK_LIB(zephyr, ZInitLocationInfo, AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [], [Have ZInitLocationInfo]),) |
|---|
| 69 | |
|---|
| 70 | AC_ARG_ENABLE([athstatic], AS_HELP_STRING([--enable-athstatic], |
|---|
| 71 | [Statically link libraries in /usr/athena/lib]), |
|---|
| 72 | [ATHSTATIC=./athstatic], |
|---|
| 73 | [ATHSTATIC=]) |
|---|
| 74 | |
|---|
| 75 | AC_CHECK_FUNCS(use_default_colors resizeterm des_string_to_key des_key_sched des_ecb_encrypt) |
|---|
| 76 | AC_CHECK_FUNCS( DES_string_to_key DES_ecb_encrypt DES_key_sched) |
|---|
| 77 | |
|---|
| 78 | AC_MSG_CHECKING(for des_ecb_encrypt prototype) |
|---|
| 79 | AC_TRY_COMPILE([#include <des.h> |
|---|
| 80 | int des_ecb_encrypt(char foo[], char bar[], des_key_schedule baz, int qux);], |
|---|
| 81 | [int foo = des_ecb_encrypt(0,0,0,0);], |
|---|
| 82 | ac_cv_des_ecb_encrypt_proto=no, |
|---|
| 83 | ac_cv_des_ecb_encrypt_proto=yes) |
|---|
| 84 | AC_MSG_RESULT($ac_cv_des_ecb_encrypt_proto) |
|---|
| 85 | if test "$ac_cv_des_ecb_encrypt_proto" = yes; then |
|---|
| 86 | AC_DEFINE([HAVE_DES_ECB_ENCRYPT_PROTO], [], [have proto for des_ecb_encrypt]) |
|---|
| 87 | fi |
|---|
| 88 | |
|---|
| 89 | dnl Checks for header files. |
|---|
| 90 | AC_HEADER_STDC |
|---|
| 91 | AC_HEADER_SYS_WAIT |
|---|
| 92 | AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd.h com_err.h) |
|---|
| 93 | |
|---|
| 94 | dnl Add CFLAGS for embeded perl |
|---|
| 95 | FOO=`perl -MExtUtils::Embed -e ccopts` |
|---|
| 96 | echo Adding perl CFLAGS ${FOO} |
|---|
| 97 | CFLAGS=${CFLAGS}\ ${FOO} |
|---|
| 98 | |
|---|
| 99 | dnl Find the location of perl XSUBPP |
|---|
| 100 | AC_MSG_CHECKING(for the perl xsubpp precompiler) |
|---|
| 101 | XSUBPPDIR="`(perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;') | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`" |
|---|
| 102 | if test -n "${XSUBPPDIR}"; then |
|---|
| 103 | AC_MSG_RESULT(${XSUBPPDIR}) |
|---|
| 104 | else |
|---|
| 105 | AC_MSG_ERROR(not found) |
|---|
| 106 | fi |
|---|
| 107 | |
|---|
| 108 | if test -f "${XSUBPPDIR}/typemap"; then |
|---|
| 109 | XSUBPPFLAGS="-typemap ${XSUBPPDIR}/typemap" |
|---|
| 110 | else |
|---|
| 111 | XSUBPPFLAGS="" |
|---|
| 112 | fi |
|---|
| 113 | |
|---|
| 114 | dnl Add LDFLAGS for embedded perl |
|---|
| 115 | FOO=`perl -MExtUtils::Embed -e ldopts` |
|---|
| 116 | echo Adding perl LDFLAGS ${FOO} |
|---|
| 117 | LDFLAGS=${LDFLAGS}\ ${FOO} |
|---|
| 118 | |
|---|
| 119 | dnl Add CFLAGS and LDFLAGS for glib-2.0 |
|---|
| 120 | PKG_CHECK_MODULES(GLIB,glib-2.0) |
|---|
| 121 | |
|---|
| 122 | echo Adding glib-2.0 CFLAGS ${GLIB_CFLAGS} |
|---|
| 123 | CFLAGS="${GLIB_CFLAGS} ${CFLAGS}" |
|---|
| 124 | echo Adding glib-2.0 LDFLAGS ${GLIB_LIBS} |
|---|
| 125 | LDFLAGS="${GLIB_LIBS} ${LDFLAGS}" |
|---|
| 126 | |
|---|
| 127 | |
|---|
| 128 | dnl Checks for typedefs, structures, and compiler characteristics. |
|---|
| 129 | |
|---|
| 130 | AC_SUBST(XSUBPPDIR) |
|---|
| 131 | AC_SUBST(XSUBPPFLAGS) |
|---|
| 132 | AC_SUBST(ATHSTATIC) |
|---|
| 133 | |
|---|
| 134 | AC_PROG_INSTALL |
|---|
| 135 | |
|---|
| 136 | AC_CONFIG_SUBDIRS(libfaim) |
|---|
| 137 | |
|---|
| 138 | AC_OUTPUT(Makefile) |
|---|