Index: configure.ac
===================================================================
--- configure.ac	(revision 40977238e21a877568df2968181b55aaee67f53a)
+++ configure.ac	(revision c08a72568ffb178aa943639541c5ce61a7fd77d6)
@@ -1,14 +1,10 @@
 dnl $Id$
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT(owl.c)
+AC_INIT([BarnOwl],[1.1.2],[bug-barnowl@mit.edu])
+AM_INIT_AUTOMAKE([-Wall foreign])
 
-AC_CONFIG_HEADER(config.h)
+AC_CONFIG_HEADER([config.h])
 
 AC_PROG_CC
-
-dnl If we're using GCC, enable all warnings
-if test "$GCC" = yes; then
-     CFLAGS="$CFLAGS -Wall -g";
-fi
 
 dnl Check for Athena
@@ -46,26 +42,15 @@
         AC_MSG_RESULT(no)
 fi
+PROTECT_CFLAGS=${PROTECT_CFLAGS-"-fstack-protector"}
+SAVE_CFLAGS=$CFLAGS
+CFLAGS="$CFLAGS $PROTECT_CFLAGS"
+AC_MSG_CHECKING(whether protection cflags work)
+AC_COMPILE_IFELSE(int i;,
+    [AC_MSG_RESULT(yes)],
+    [AC_MSG_RESULT(no)
+    CFLAGS=$SAVE_CFLAGS])
 
-AC_ARG_WITH([stack-protector],
-  [AS_HELP_STRING([--with-stack-protector],
-    [Enable gcc -fstack-protector])],
-  [],
-  [with_stack_protector=check])
 
-AS_IF([test "x$with_stack_protector" != xno],
-  [
-    SAVE_CFLAGS=$CFLAGS
-    CFLAGS="$CFLAGS -fstack-protector"
-    AC_MSG_CHECKING(whether protection cflags work)
-    AC_COMPILE_IFELSE(int i;,
-        [AC_MSG_RESULT(yes)],
-        [AC_MSG_RESULT(no)
-        CFLAGS=$SAVE_CFLAGS
-        if test "x$with_stack_protector" != xcheck; then
-          AC_MSG_FAILURE([--with-stack-protector selected, but gcc does support it.])
-        fi])
-    AC_CHECK_LIB(ssp, __stack_chk_guard)
-  ])
-
+AC_CHECK_LIB(ssp, __stack_chk_guard)
 AC_CHECK_LIB(ncursesw, initscr,, AC_MSG_ERROR(No libncursesw found.))
 AC_CHECK_LIB(com_err, com_err)
@@ -75,30 +60,7 @@
 AC_CHECK_LIB(des425, des_cbc_encrypt,,AC_CHECK_LIB(crypto,DES_cbc_encrypt))
 AC_CHECK_LIB(resolv, res_search)
-
-AC_ARG_WITH([zephyr],
-  [AS_HELP_STRING([--with-libzephyr],
-    [Disable Zephyr support])],
-  [],
-  [with_zephyr=check])
-
-AS_IF([test "x$with_zephyr" != xno],
-  [AC_CHECK_LIB([zephyr], [ZGetSender],
-   [LIBS="$LIBS -lzephyr"
-    AC_DEFINE([HAVE_LIBZEPHYR], [1],
-                [Define if you have libzephyr])
-    AC_CHECK_LIB([zephyr], [ZInitLocationInfo],
-      AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [1],
-                [Have ZInitLocationInfo]),)
-   ],
-   [if test "x$with_zephyr" != xcheck; then
-      AC_MSG_FAILURE(
-        [--with-libzephyr was given, but libzephyr does not seem to be available.])
-    fi
-   ])])
-
-AC_ARG_ENABLE([athstatic], AS_HELP_STRING([--enable-athstatic],
-                                          [Statically link libraries in /usr/athena/lib]),
-                                          [ATHSTATIC=./athstatic],
-                                          [ATHSTATIC=])
+dnl AC_CHECK_LIB(zephyr, ZGetSender,, AC_MSG_ERROR(No zephyr library found.))
+AC_CHECK_LIB(zephyr, ZGetSender)
+AC_CHECK_LIB(zephyr, ZInitLocationInfo, AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [], [Have ZInitLocationInfo]),)
 
 AC_CHECK_FUNCS(use_default_colors resizeterm des_string_to_key des_key_sched des_ecb_encrypt)
@@ -143,6 +105,6 @@
 dnl Add LDFLAGS for embedded perl
 FOO=`perl -MExtUtils::Embed -e ldopts`
-AC_MSG_NOTICE([Adding perl LDFLAGS ${FOO}])
-LDFLAGS=${LDFLAGS}\ ${FOO}
+AC_MSG_NOTICE([Adding perl LIBS ${FOO}])
+LIBS=${LIBS}\ ${FOO}
 
 dnl Add CFLAGS and LDFLAGS for glib-2.0
@@ -154,16 +116,19 @@
 LDFLAGS="${GLIB_LIBS} ${LDFLAGS}"
 
+if test "x${prefix}" = "xNONE"; then
+   prefix="${ac_default_prefix}"
+fi
+
+AC_DEFINE_UNQUOTED([DATADIR],["${prefix}/share/${PACKAGE}"],
+                   [Package data directory])
+
 dnl Checks for typedefs, structures, and compiler characteristics.
-
-dnl Support --program-{prefix,suffix,transform}
-AC_ARG_PROGRAM
 
 AC_SUBST(XSUBPPDIR)
 AC_SUBST(XSUBPPFLAGS)
-AC_SUBST(ATHSTATIC)
 
 AC_PROG_INSTALL
+AC_PROG_RANLIB
 
-AC_CONFIG_SUBDIRS(libfaim)
-
-AC_OUTPUT(Makefile)
+AC_CONFIG_FILES([Makefile libfaim/Makefile])
+AC_OUTPUT([perl/modules/Makefile])
