| 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 | AC_MSG_RESULT(yes) |
|---|
| 19 | else |
|---|
| 20 | AC_MSG_RESULT(no) |
|---|
| 21 | fi |
|---|
| 22 | AC_MSG_CHECKING(for /usr/athena/lib) |
|---|
| 23 | if test -d /usr/athena/lib; then |
|---|
| 24 | LDFLAGS=-L/usr/athena/lib\ ${LDFLAGS} |
|---|
| 25 | AC_MSG_RESULT(yes) |
|---|
| 26 | else |
|---|
| 27 | AC_MSG_RESULT(no) |
|---|
| 28 | fi |
|---|
| 29 | |
|---|
| 30 | dnl A hack for myself to use gnu curses |
|---|
| 31 | dnl AC_MSG_CHECKING(for mit gnu hack) |
|---|
| 32 | dnl if test -d /mit/gnu/include; then |
|---|
| 33 | dnl CFLAGS=${CFLAGS}\ -I/mit/gnu/include |
|---|
| 34 | dnl AC_MSG_RESULT(yes) |
|---|
| 35 | dnl else |
|---|
| 36 | dnl AC_MSG_RESULT(no) |
|---|
| 37 | dnl fi |
|---|
| 38 | |
|---|
| 39 | |
|---|
| 40 | dnl Solaris ships with a broken curses.h |
|---|
| 41 | dnl AC_MSG_CHECKING(for solaris broken curses.h) |
|---|
| 42 | dnl if grep "Sun Microsystems" /usr/include/curses.h > /dev/null 2> /dev/null; then |
|---|
| 43 | dnl if test "`grep -c getwc\(stdin\) /usr/include/widec.h`" = "2" ; then |
|---|
| 44 | dnl rm -rf includefix |
|---|
| 45 | dnl mkdir includefix |
|---|
| 46 | dnl sed -e 's/<widec.h>/\"widec.h\"/' /usr/include/curses.h > ./includefix/curses.h |
|---|
| 47 | dnl |
|---|
| 48 | dnl sed -e 's/<wchar.h>/\"wchar.h\"/' \ |
|---|
| 49 | dnl -e 's/^#define.putwchar.*//' \ |
|---|
| 50 | dnl -e 's/^#define.getwchar().*//' \ |
|---|
| 51 | dnl -e 's/^#define.getwc(p).*//' \ |
|---|
| 52 | dnl -e 's/^#define.putwc(x, p).*//' \ |
|---|
| 53 | dnl /usr/include/widec.h > includefix/widec.h |
|---|
| 54 | dnl CFLAGS=-I./includefix\ ${CFLAGS} |
|---|
| 55 | dnl AC_MSG_RESULT(yes) |
|---|
| 56 | dnl fi |
|---|
| 57 | dnl else |
|---|
| 58 | dnl AC_MSG_RESULT(no) |
|---|
| 59 | dnl fi |
|---|
| 60 | |
|---|
| 61 | |
|---|
| 62 | |
|---|
| 63 | AC_CHECK_LIB(ncurses, initscr,, |
|---|
| 64 | AC_CHECK_LIB(curses, initscr,, AC_MSG_ERROR(No curses library found.))) |
|---|
| 65 | AC_CHECK_LIB(com_err, com_err) |
|---|
| 66 | AC_CHECK_LIB(nsl, gethostbyname) |
|---|
| 67 | AC_CHECK_LIB(socket, socket) |
|---|
| 68 | AC_CHECK_LIB(k5crypto, krb5_derive_key) |
|---|
| 69 | AC_CHECK_LIB(des425, des425_req_act_vno) |
|---|
| 70 | AC_CHECK_LIB(krb5, krb5_get_credentials) |
|---|
| 71 | AC_CHECK_LIB(krb4, krb_sendauth) |
|---|
| 72 | AC_CHECK_LIB(zephyr, ZGetSender,, AC_MSG_ERROR(No zephyr library found.)) |
|---|
| 73 | AC_CHECK_LIB(zephyr, ZInitLocationInfo, AC_DEFINE(HAVE_LIBZEPHYR_ZINITLOCATIONINFO),) |
|---|
| 74 | |
|---|
| 75 | dnl Checks for header files. |
|---|
| 76 | AC_HEADER_STDC |
|---|
| 77 | AC_HEADER_SYS_WAIT |
|---|
| 78 | AC_CHECK_HEADERS(strings.h sys/ioctl.h unistd.h) |
|---|
| 79 | |
|---|
| 80 | dnl Add CFLAGS for embeded perl |
|---|
| 81 | FOO=`perl -MExtUtils::Embed -e ccopts` |
|---|
| 82 | echo Adding perl CFLAGS ${FOO} |
|---|
| 83 | CFLAGS=${CFLAGS}\ ${FOO} |
|---|
| 84 | |
|---|
| 85 | dnl Add LDFLAGS for embeded perl |
|---|
| 86 | FOO=`perl -MExtUtils::Embed -e ldopts` |
|---|
| 87 | echo Adding perl LDFLAGS ${FOO} |
|---|
| 88 | LDFLAGS=${LDFLAGS}\ ${FOO} |
|---|
| 89 | |
|---|
| 90 | dnl Checks for typedefs, structures, and compiler characteristics. |
|---|
| 91 | AC_CHECK_FILE(/usr/share/terminfo, AC_DEFINE(TERMINFO, "/usr/share/terminfo"), |
|---|
| 92 | AC_CHECK_FILE(/usr/share/lib/terminfo, AC_DEFINE(TERMINFO, "/usr/share/lib/terminfo"), |
|---|
| 93 | AC_MSG_ERROR(No terminfo found for this system))) |
|---|
| 94 | |
|---|
| 95 | dnl Checks for library functions. |
|---|
| 96 | dnl AC_PROG_GCC_TRADITIONAL |
|---|
| 97 | dnl AC_CHECK_FUNCS(gethostname strdup) |
|---|
| 98 | |
|---|
| 99 | AC_OUTPUT(Makefile) |
|---|