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