| [1aee7d9] | 1 | dnl $Id$ |
|---|
| [7d4fbcd] | 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 |
|---|
| [e6449bc] | 18 | CPPFLAGS=${CPPFLAGS}\ -I/usr/athena/include |
|---|
| [7d4fbcd] | 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 |
|---|
| [1d7e094] | 25 | LDFLAGS=${LDFLAGS}\ -L/usr/athena/lib |
|---|
| [7d4fbcd] | 26 | AC_MSG_RESULT(yes) |
|---|
| 27 | else |
|---|
| 28 | AC_MSG_RESULT(no) |
|---|
| 29 | fi |
|---|
| 30 | |
|---|
| [fe39450] | 31 | dnl Check for kerberosIV include |
|---|
| [18e28a4] | 32 | AC_MSG_CHECKING(for kerberosIV) |
|---|
| [fe39450] | 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) |
|---|
| [18e28a4] | 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) |
|---|
| [b5fe6d2] | 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) |
|---|
| [fe39450] | 45 | else |
|---|
| 46 | AC_MSG_RESULT(no) |
|---|
| 47 | fi |
|---|
| [87afe92] | 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]) |
|---|
| [fe39450] | 56 | |
|---|
| [87afe92] | 57 | |
|---|
| 58 | AC_CHECK_LIB(ssp, __stack_chk_guard) |
|---|
| [d54035d] | 59 | AC_CHECK_LIB(ncursesw, initscr,, AC_MSG_ERROR(No libncursesw found.)) |
|---|
| [7d4fbcd] | 60 | AC_CHECK_LIB(com_err, com_err) |
|---|
| 61 | AC_CHECK_LIB(nsl, gethostbyname) |
|---|
| 62 | AC_CHECK_LIB(socket, socket) |
|---|
| [8298425] | 63 | dnl AC_CHECK_LIB(des425, req_act_vno) |
|---|
| [b5fe6d2] | 64 | AC_CHECK_LIB(des425, des_cbc_encrypt,,AC_CHECK_LIB(crypto,DES_cbc_encrypt)) |
|---|
| [d09e5a1] | 65 | AC_CHECK_LIB(resolv, res_search) |
|---|
| [2c270e6] | 66 | |
|---|
| 67 | AC_ARG_WITH([zephyr], |
|---|
| 68 | [AS_HELP_STRING([--with-libzephyr], |
|---|
| 69 | [Disable Zephyr support])], |
|---|
| 70 | [], |
|---|
| 71 | [with_zephyr=check]) |
|---|
| 72 | |
|---|
| 73 | AS_IF([test "x$with_zephyr" != xno], |
|---|
| 74 | [AC_CHECK_LIB([zephyr], [ZGetSender], |
|---|
| 75 | [AC_DEFINE([HAVE_LIBZEPHYR], [1], |
|---|
| 76 | [Define if you have libzephyr]) |
|---|
| 77 | AC_CHECK_LIB([zephyr], [ZInitLocationInfo], |
|---|
| 78 | AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [1], |
|---|
| 79 | [Have ZInitLocationInfo]),) |
|---|
| 80 | ], |
|---|
| 81 | [if test "x$with_zephyr" != xcheck; then |
|---|
| 82 | AC_MSG_FAILURE( |
|---|
| 83 | [--with-libzephyr was given, but libzephyr does not seem to be available.]) |
|---|
| 84 | fi |
|---|
| 85 | ])]) |
|---|
| [ac70242] | 86 | |
|---|
| [7ccc780] | 87 | AC_ARG_ENABLE([athstatic], AS_HELP_STRING([--enable-athstatic], |
|---|
| 88 | [Statically link libraries in /usr/athena/lib]), |
|---|
| 89 | [ATHSTATIC=./athstatic], |
|---|
| 90 | [ATHSTATIC=]) |
|---|
| 91 | |
|---|
| [dc2ad79] | 92 | AC_CHECK_FUNCS(use_default_colors resizeterm des_string_to_key des_key_sched des_ecb_encrypt) |
|---|
| [b5fe6d2] | 93 | AC_CHECK_FUNCS( DES_string_to_key DES_ecb_encrypt DES_key_sched) |
|---|
| [e51b410] | 94 | |
|---|
| [ac70242] | 95 | AC_MSG_CHECKING(for des_ecb_encrypt prototype) |
|---|
| 96 | AC_TRY_COMPILE([#include <des.h> |
|---|
| 97 | int des_ecb_encrypt(char foo[], char bar[], des_key_schedule baz, int qux);], |
|---|
| 98 | [int foo = des_ecb_encrypt(0,0,0,0);], |
|---|
| 99 | ac_cv_des_ecb_encrypt_proto=no, |
|---|
| 100 | ac_cv_des_ecb_encrypt_proto=yes) |
|---|
| 101 | AC_MSG_RESULT($ac_cv_des_ecb_encrypt_proto) |
|---|
| 102 | if test "$ac_cv_des_ecb_encrypt_proto" = yes; then |
|---|
| 103 | AC_DEFINE([HAVE_DES_ECB_ENCRYPT_PROTO], [], [have proto for des_ecb_encrypt]) |
|---|
| 104 | fi |
|---|
| [7d4fbcd] | 105 | |
|---|
| 106 | dnl Checks for header files. |
|---|
| 107 | AC_HEADER_STDC |
|---|
| 108 | AC_HEADER_SYS_WAIT |
|---|
| [e8b95f8] | 109 | AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd.h com_err.h) |
|---|
| [7d4fbcd] | 110 | |
|---|
| 111 | dnl Add CFLAGS for embeded perl |
|---|
| 112 | FOO=`perl -MExtUtils::Embed -e ccopts` |
|---|
| [7c09b21] | 113 | AC_MSG_NOTICE([Adding perl CFLAGS ${FOO}]) |
|---|
| [7d4fbcd] | 114 | CFLAGS=${CFLAGS}\ ${FOO} |
|---|
| 115 | |
|---|
| [e51b410] | 116 | dnl Find the location of perl XSUBPP |
|---|
| [8ee73f8d] | 117 | AC_MSG_CHECKING(for the perl xsubpp precompiler) |
|---|
| [6794f72] | 118 | XSUBPPDIR="`(perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;') | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`" |
|---|
| [8ee73f8d] | 119 | if test -n "${XSUBPPDIR}"; then |
|---|
| 120 | AC_MSG_RESULT(${XSUBPPDIR}) |
|---|
| 121 | else |
|---|
| 122 | AC_MSG_ERROR(not found) |
|---|
| 123 | fi |
|---|
| 124 | |
|---|
| [4ad3480] | 125 | if test -f "${XSUBPPDIR}/typemap"; then |
|---|
| 126 | XSUBPPFLAGS="-typemap ${XSUBPPDIR}/typemap" |
|---|
| 127 | else |
|---|
| 128 | XSUBPPFLAGS="" |
|---|
| 129 | fi |
|---|
| 130 | |
|---|
| [18e28a4] | 131 | dnl Add LDFLAGS for embedded perl |
|---|
| [3f21b8e] | 132 | FOO=`perl -MExtUtils::Embed -e ldopts` |
|---|
| [7c09b21] | 133 | AC_MSG_NOTICE([Adding perl LDFLAGS ${FOO}]) |
|---|
| [7d4fbcd] | 134 | LDFLAGS=${LDFLAGS}\ ${FOO} |
|---|
| 135 | |
|---|
| [34509d5] | 136 | dnl Add CFLAGS and LDFLAGS for glib-2.0 |
|---|
| 137 | PKG_CHECK_MODULES(GLIB,glib-2.0) |
|---|
| 138 | |
|---|
| [7c09b21] | 139 | AC_MSG_NOTICE([Adding glib-2.0 CFLAGS ${GLIB_CFLAGS}]) |
|---|
| [d9337637] | 140 | CFLAGS="${GLIB_CFLAGS} ${CFLAGS}" |
|---|
| [7c09b21] | 141 | AC_MSG_NOTICE([Adding glib-2.0 LDFLAGS ${GLIB_LIBS}]) |
|---|
| [d9337637] | 142 | LDFLAGS="${GLIB_LIBS} ${LDFLAGS}" |
|---|
| [34509d5] | 143 | |
|---|
| [7d4fbcd] | 144 | dnl Checks for typedefs, structures, and compiler characteristics. |
|---|
| 145 | |
|---|
| [c50f589] | 146 | dnl Support --program-{prefix,suffix,transform} |
|---|
| 147 | AC_ARG_PROGRAM |
|---|
| 148 | |
|---|
| [15bd5ef] | 149 | AC_SUBST(XSUBPPDIR) |
|---|
| [4ad3480] | 150 | AC_SUBST(XSUBPPFLAGS) |
|---|
| [7ccc780] | 151 | AC_SUBST(ATHSTATIC) |
|---|
| [8ee73f8d] | 152 | |
|---|
| [ac70242] | 153 | AC_PROG_INSTALL |
|---|
| 154 | |
|---|
| [d09e5a1] | 155 | AC_CONFIG_SUBDIRS(libfaim) |
|---|
| 156 | |
|---|
| [7d4fbcd] | 157 | AC_OUTPUT(Makefile) |
|---|