Index: Makefile.am
===================================================================
--- Makefile.am	(revision 353719a2ddec4d6a8458ee42af37514fedbd80bf)
+++ Makefile.am	(revision 3624a2caf75400743f257ffcf68a274d6d21f689)
@@ -12,19 +12,31 @@
 
 check_PROGRAMS = tester.bin
+dist_check_DATA = t
+dist_check_SCRIPTS = runtests.sh
+
+bin_SCRIPTS = barnowl
+check_SCRIPTS = tester
+
+barnowl tester: %: barnowl-wrapper.in %.bin Makefile
+	sed \
+	    -e 's,[@]abs_srcdir[@],$(abs_srcdir),g' \
+	    -e 's,[@]abs_builddir[@],$(abs_builddir),g' \
+	    $< > $@
+	chmod +x $@
 
 barnowl_bin_SOURCES = $(BASE_SRCS) \
-     owl.h owl_perl.h config.h \
-     owl.c \
-     $(GEN_C) $(GEN_H)
+     owl.h owl_perl.h \
+     owl.c
+nodist_barnowl_bin_SOURCES = $(GEN_C) $(GEN_H)
 
-man_MANS = doc/barnowl.1
-doc_DATA = doc/intro.txt doc/advanced.txt
+dist_man_MANS = doc/barnowl.1
+dist_doc_DATA = doc/intro.txt doc/advanced.txt
 
 barnowl_bin_LDADD = compat/libcompat.a libfaim/libfaim.a
 
 tester_bin_SOURCES = $(BASE_SRCS) \
-     owl.h owl_perl.h config.h \
-     $(GEN_C) $(GEN_H) \
+     owl.h owl_perl.h \
      tester.c
+nodist_tester_bin_SOURCES = $(GEN_C) $(GEN_H)
 
 tester_bin_LDADD = compat/libcompat.a libfaim/libfaim.a
@@ -32,5 +44,5 @@
 TESTS=runtests.sh
 
-AM_CPPFLAGS = -I$(top_srcdir)/ \
+AM_CPPFLAGS = \
            -I$(top_srcdir)/libfaim/ \
            -DDATADIR='"$(pkgdatadir)"' \
@@ -48,10 +60,10 @@
      mainpanel.c msgwin.c sepbar.c editcontext.c signal.c closures.c
 
-NORMAL_SRCS = filterproc.c window.c windowcb.c
+NORMAL_SRCS = filterproc.c filterproc.h window.c window.h windowcb.c
 
 BASE_SRCS = $(CODELIST_SRCS) $(NORMAL_SRCS)
 
 GEN_C = varstubs.c perlglue.c gmarshal_funcs.c
-GEN_H = owl_prototypes.h gmarshal_funcs.h
+GEN_H = owl_prototypes.h owl_prototypes.h.new gmarshal_funcs.h
 
 BUILT_SOURCES = $(GEN_C) $(GEN_H)
@@ -66,6 +78,6 @@
 proto: owl_prototypes.h
 
-perlglue.c: perlglue.xs $(TYPEMAP)
-	$(AM_V_GEN)perl $(XSUBPPDIR)/xsubpp $(XSUBPPFLAGS) -prototypes perlglue.xs > perlglue.c
+perlglue.c: perlglue.xs typemap
+	$(AM_V_GEN)perl $(XSUBPPDIR)/xsubpp $(XSUBPPFLAGS) -prototypes $< > $@
 
 varstubs.c: stubgen.pl variable.c
@@ -84,8 +96,4 @@
 	$(COMPILE) -Wall -Wextra -pedantic -fsyntax-only $(CHK_SOURCES)
 
-install-data-local:
-	$(mkinstalldirs) ${DESTDIR}${pkgdatadir}/lib
-	(cd perl/lib && tar -cf - . ) | (cd ${DESTDIR}${pkgdatadir}/lib && tar -xf - )
-
 do_transform = $(shell echo '$(1)' | sed '$(transform)')
 install-exec-hook:
@@ -93,3 +101,19 @@
 	      $(DESTDIR)$(bindir)/$(call do_transform,barnowl)
 
+uninstall-local:
+	rm -f $(DESTDIR)$(bindir)/$(call do_transform,barnowl)
+
+CLEANFILES = $(BUILT_SOURCES) $(bin_SCRIPTS) $(check_SCRIPTS)
+EXTRA_DIST = \
+    autogen.sh \
+    barnowl-wrapper.in \
+    codelist.pl \
+    doc \
+    examples \
+    marshal_types \
+    perlglue.xs \
+    scripts \
+    stubgen.pl \
+    typemap
+
 SUBDIRS = compat libfaim perl
Index: rnowl
===================================================================
--- barnowl	(revision f5f6ec067fe480f0aed227fce942d421060bc498)
+++ 	(revision )
@@ -1,18 +1,0 @@
-#!/bin/sh
-# This is a wrapper script to point BARNOWL_DATA_DIR at the source dir
-# if we're running from a build tree. barnowl.bin is the actual built
-# binary.
-
-SRCDIR=`dirname "${0}"`
-EXE="$0.bin"
-
-if test ! -x "$EXE"; then
-    echo "Cannot find $EXE" >&2
-    exit 1
-fi
-
-BARNOWL_DATA_DIR="$SRCDIR/perl/"
-BARNOWL_BIN_DIR="$SRCDIR/"
-export BARNOWL_DATA_DIR
-export BARNOWL_BIN_DIR
-exec "$EXE" "$@"
Index: barnowl-wrapper.in
===================================================================
--- barnowl-wrapper.in	(revision 1dba5bd6597e43916c5deadbf9310a2f3eb77438)
+++ barnowl-wrapper.in	(revision 1dba5bd6597e43916c5deadbf9310a2f3eb77438)
@@ -0,0 +1,17 @@
+#!/bin/sh
+# This is a wrapper script to point BARNOWL_DATA_DIR at the source dir
+# if we're running from a build tree. barnowl.bin is the actual built
+# binary.
+
+EXE="$0.bin"
+
+if test ! -x "$EXE"; then
+    echo "Cannot find $EXE" >&2
+    exit 1
+fi
+
+BARNOWL_DATA_DIR="@abs_srcdir@/perl"
+BARNOWL_BIN_DIR="@abs_builddir@"
+export BARNOWL_DATA_DIR
+export BARNOWL_BIN_DIR
+exec "$EXE" "$@"
Index: compat/Makefile.am
===================================================================
--- compat/Makefile.am	(revision 12a661639871bb625800f2c9d0e5a008aa7b1c37)
+++ compat/Makefile.am	(revision b80bae0f45310e8c15e8fe6e2ecc23ab30c9cc39)
@@ -1,4 +1,4 @@
 noinst_LIBRARIES = libcompat.a
 
-libcompat_a_SOURCES =
+libcompat_a_SOURCES = compat.h
 libcompat_a_LIBADD = $(LIBOBJS)
Index: compat/compat.h
===================================================================
--- compat/compat.h	(revision 4dde585fcac5c152e22a20684548501eaf803869)
+++ compat/compat.h	(revision 6249a88f828fc12fc0fc17905474a3de4efcd3e8)
@@ -2,5 +2,5 @@
 #define INC_BARNOWL_COMPAT_COMPAT_H
 
-#include "../config.h"
+#include <config.h>
 
 #include <stddef.h>
Index: configure.ac
===================================================================
--- configure.ac	(revision 06e04a995f32e4c88df08bff7baf37fb5bc8a59c)
+++ configure.ac	(revision eb5e8fc6ce7cdd350be66aa869a84308ead60382)
@@ -100,5 +100,5 @@
 dnl Find the location of perl XSUBPP
 AC_MSG_CHECKING(for the perl xsubpp precompiler)
-XSUBPPDIR="`(perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;') | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`"
+XSUBPPDIR="`cd "$srcdir" && perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;' | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`"
 if test -n "${XSUBPPDIR}"; then
    AC_MSG_RESULT(${XSUBPPDIR})
Index: filterproc.c
===================================================================
--- filterproc.c	(revision 3496369c2871b87831bd7bcfef61f8cc5bf36a3c)
+++ filterproc.c	(revision 71559554be7228aeb71cbad22d99ae9cfc4d1380)
@@ -1,5 +1,9 @@
-#include "owl.h"
+#include "filterproc.h"
 #include <sys/wait.h>
+#include <fcntl.h>
+#include <glib.h>
 #include <poll.h>
+#include <string.h>
+#include <unistd.h>
 
 /* Even in case of error, send_receive is responsible for closing wfd
Index: libfaim/Makefile.am
===================================================================
--- libfaim/Makefile.am	(revision 215c119ee835ac36d645babc2e3c04da7e9b44a3)
+++ libfaim/Makefile.am	(revision b80bae0f45310e8c15e8fe6e2ecc23ab30c9cc39)
@@ -13,2 +13,4 @@
 libfaim_a_CPPFLAGS = -DAIM_BUILDDATE=\"x\" -DAIM_BUILDTIME=\"x\" \
                      -I${top_srcdir}/libfaim
+
+EXTRA_DIST = oscar.c
Index: m4/ax_append_compile_flags.m4
===================================================================
--- m4/ax_append_compile_flags.m4	(revision e9b4a2c177afeb12da06aa7ae83b6b507719bc72)
+++ m4/ax_append_compile_flags.m4	(revision e9b4a2c177afeb12da06aa7ae83b6b507719bc72)
@@ -0,0 +1,65 @@
+# ===========================================================================
+#  http://www.gnu.org/software/autoconf-archive/ax_append_compile_flags.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_APPEND_COMPILE_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS])
+#
+# DESCRIPTION
+#
+#   For every FLAG1, FLAG2 it is checked whether the compiler works with the
+#   flag.  If it does, the flag is added FLAGS-VARIABLE
+#
+#   If FLAGS-VARIABLE is not specified, the current language's flags (e.g.
+#   CFLAGS) is used.  During the check the flag is always added to the
+#   current language's flags.
+#
+#   If EXTRA-FLAGS is defined, it is added to the current language's default
+#   flags (e.g. CFLAGS) when the check is done.  The check is thus made with
+#   the flags: "CFLAGS EXTRA-FLAGS FLAG".  This can for example be used to
+#   force the compiler to issue an error when a bad flag is given.
+#
+#   NOTE: This macro depends on the AX_APPEND_FLAG and
+#   AX_CHECK_COMPILE_FLAG. Please keep this macro in sync with
+#   AX_APPEND_LINK_FLAGS.
+#
+# LICENSE
+#
+#   Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
+#
+#   This program is free software: you can redistribute it and/or modify it
+#   under the terms of the GNU General Public License as published by the
+#   Free Software Foundation, either version 3 of the License, or (at your
+#   option) any later version.
+#
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+#   Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License along
+#   with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+
+#serial 3
+
+AC_DEFUN([AX_APPEND_COMPILE_FLAGS],
+[AC_REQUIRE([AX_CHECK_COMPILE_FLAG])
+AC_REQUIRE([AX_APPEND_FLAG])
+for flag in $1; do
+  AX_CHECK_COMPILE_FLAG([$flag], [AX_APPEND_FLAG([$flag], [$2])], [], [$3])
+done
+])dnl AX_APPEND_COMPILE_FLAGS
Index: m4/ax_append_flag.m4
===================================================================
--- m4/ax_append_flag.m4	(revision e9b4a2c177afeb12da06aa7ae83b6b507719bc72)
+++ m4/ax_append_flag.m4	(revision e9b4a2c177afeb12da06aa7ae83b6b507719bc72)
@@ -0,0 +1,69 @@
+# ===========================================================================
+#      http://www.gnu.org/software/autoconf-archive/ax_append_flag.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE])
+#
+# DESCRIPTION
+#
+#   FLAG is appended to the FLAGS-VARIABLE shell variable, with a space
+#   added in between.
+#
+#   If FLAGS-VARIABLE is not specified, the current language's flags (e.g.
+#   CFLAGS) is used.  FLAGS-VARIABLE is not changed if it already contains
+#   FLAG.  If FLAGS-VARIABLE is unset in the shell, it is set to exactly
+#   FLAG.
+#
+#   NOTE: Implementation based on AX_CFLAGS_GCC_OPTION.
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#   Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
+#
+#   This program is free software: you can redistribute it and/or modify it
+#   under the terms of the GNU General Public License as published by the
+#   Free Software Foundation, either version 3 of the License, or (at your
+#   option) any later version.
+#
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+#   Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License along
+#   with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+
+#serial 2
+
+AC_DEFUN([AX_APPEND_FLAG],
+[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX
+AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])])dnl
+AS_VAR_SET_IF(FLAGS,
+  [case " AS_VAR_GET(FLAGS) " in
+    *" $1 "*)
+      AC_RUN_LOG([: FLAGS already contains $1])
+      ;;
+    *)
+      AC_RUN_LOG([: FLAGS="$FLAGS $1"])
+      AS_VAR_SET(FLAGS, ["AS_VAR_GET(FLAGS) $1"])
+      ;;
+   esac],
+  [AS_VAR_SET(FLAGS,["$1"])])
+AS_VAR_POPDEF([FLAGS])dnl
+])dnl AX_APPEND_FLAG
Index: m4/ax_cflags_warn_all.m4
===================================================================
--- m4/ax_cflags_warn_all.m4	(revision 378ede7fe64a6d7900e76c997f9ba925c91639fc)
+++ m4/ax_cflags_warn_all.m4	(revision e9b4a2c177afeb12da06aa7ae83b6b507719bc72)
@@ -25,4 +25,6 @@
 #    - $3 action-if-found : add value to shellvariable
 #    - $4 action-if-not-found : nothing
+#
+#   NOTE: These macros depend on AX_APPEND_FLAG.
 #
 # LICENSE
@@ -57,97 +59,12 @@
 #   exception to the GPL to apply to your modified version as well.
 
-#serial 10
+#serial 14
 
-AC_DEFUN([AX_CFLAGS_WARN_ALL],[dnl
-AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
-AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_warn_all])dnl
+AC_DEFUN([AX_FLAGS_WARN_ALL],[dnl
+AS_VAR_PUSHDEF([FLAGS],[_AC_LANG_PREFIX[]FLAGS])dnl
+AS_VAR_PUSHDEF([VAR],[ac_cv_[]_AC_LANG_ABBREV[]flags_warn_all])dnl
 AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
 VAR,[VAR="no, unknown"
- AC_LANG_PUSH([C])
- ac_save_[]FLAGS="$[]FLAGS"
-for ac_arg dnl
-in "-pedantic  % -Wall"       dnl   GCC
-   "-xstrconst % -v"          dnl Solaris C
-   "-std1      % -verbose -w0 -warnprotos" dnl Digital Unix
-   "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
-   "-ansi -ansiE % -fullwarn" dnl IRIX
-   "+ESlit     % +w1"         dnl HP-UX C
-   "-Xc        % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10)
-   "-h conform % -h msglevel 2" dnl Cray C (Unicos)
-   #
-do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
-   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
-                     [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
-done
- FLAGS="$ac_save_[]FLAGS"
- AC_LANG_POP([C])
-])
-case ".$VAR" in
-     .ok|.ok,*) m4_ifvaln($3,$3) ;;
-   .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
-        AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
-                      m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
-   *) m4_ifvaln($3,$3,[
-   if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
-   then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
-   else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
-                      m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
-   fi ]) ;;
-esac
-AS_VAR_POPDEF([VAR])dnl
-AS_VAR_POPDEF([FLAGS])dnl
-])
-
-dnl the only difference - the LANG selection... and the default FLAGS
-
-AC_DEFUN([AX_CXXFLAGS_WARN_ALL],[dnl
-AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
-AS_VAR_PUSHDEF([VAR],[ax_cv_cxxflags_warn_all])dnl
-AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
-VAR,[VAR="no, unknown"
- AC_LANG_PUSH([C++])
- ac_save_[]FLAGS="$[]FLAGS"
-for ac_arg dnl
-in "-pedantic  % -Wall"       dnl   GCC
-   "-xstrconst % -v"          dnl Solaris C
-   "-std1      % -verbose -w0 -warnprotos" dnl Digital Unix
-   "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
-   "-ansi -ansiE % -fullwarn" dnl IRIX
-   "+ESlit     % +w1"         dnl HP-UX C
-   "-Xc        % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10)
-   "-h conform % -h msglevel 2" dnl Cray C (Unicos)
-   #
-do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
-   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
-                     [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
-done
- FLAGS="$ac_save_[]FLAGS"
- AC_LANG_POP([C++])
-])
-case ".$VAR" in
-     .ok|.ok,*) m4_ifvaln($3,$3) ;;
-   .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
-        AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
-                      m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
-   *) m4_ifvaln($3,$3,[
-   if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
-   then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
-   else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
-                      m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
-   fi ]) ;;
-esac
-AS_VAR_POPDEF([VAR])dnl
-AS_VAR_POPDEF([FLAGS])dnl
-])
-
-dnl the only difference - the LANG selection... and the default FLAGS
-
-AC_DEFUN([AX_FCFLAGS_WARN_ALL],[dnl
-AS_VAR_PUSHDEF([FLAGS],[FCFLAGS])dnl
-AS_VAR_PUSHDEF([VAR],[ax_cv_fcflags_warn_all])dnl
-AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
-VAR,[VAR="no, unknown"
- AC_LANG_PUSH([Fortran])
- ac_save_[]FLAGS="$[]FLAGS"
+ac_save_[]FLAGS="$[]FLAGS"
 for ac_arg dnl
 in "-warn all  % -warn all"   dnl Intel
@@ -165,23 +82,15 @@
                      [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
 done
- FLAGS="$ac_save_[]FLAGS"
- AC_LANG_POP([Fortran])
+FLAGS="$ac_save_[]FLAGS"
 ])
+AS_VAR_POPDEF([FLAGS])dnl
+AC_REQUIRE([AX_APPEND_FLAG])
 case ".$VAR" in
      .ok|.ok,*) m4_ifvaln($3,$3) ;;
-   .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
-        AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
-                      m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
-   *) m4_ifvaln($3,$3,[
-   if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
-   then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
-   else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
-                      m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
-   fi ]) ;;
+   .|.no|.no,*) m4_default($4,[m4_ifval($2,[AX_APPEND_FLAG([$2], [$1])])]) ;;
+   *) m4_default($3,[AX_APPEND_FLAG([$VAR], [$1])]) ;;
 esac
 AS_VAR_POPDEF([VAR])dnl
-AS_VAR_POPDEF([FLAGS])dnl
-])
-
+])dnl AX_FLAGS_WARN_ALL
 dnl  implementation tactics:
 dnl   the for-argument contains a list of options. The first part of
@@ -194,2 +103,20 @@
 dnl   delimiter. A non-option comment can be given after "%%" marks
 dnl   which will be shown but not added to the respective C/CXXFLAGS.
+
+AC_DEFUN([AX_CFLAGS_WARN_ALL],[dnl
+AC_LANG_PUSH([C])
+AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4])
+AC_LANG_POP([C])
+])
+
+AC_DEFUN([AX_CXXFLAGS_WARN_ALL],[dnl
+AC_LANG_PUSH([C++])
+AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4])
+AC_LANG_POP([C++])
+])
+
+AC_DEFUN([AX_FCFLAGS_WARN_ALL],[dnl
+AC_LANG_PUSH([Fortran])
+AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4])
+AC_LANG_POP([Fortran])
+])
Index: m4/ax_check_compile_flag.m4
===================================================================
--- m4/ax_check_compile_flag.m4	(revision e9b4a2c177afeb12da06aa7ae83b6b507719bc72)
+++ m4/ax_check_compile_flag.m4	(revision e9b4a2c177afeb12da06aa7ae83b6b507719bc72)
@@ -0,0 +1,72 @@
+# ===========================================================================
+#   http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS])
+#
+# DESCRIPTION
+#
+#   Check whether the given FLAG works with the current language's compiler
+#   or gives an error.  (Warnings, however, are ignored)
+#
+#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
+#   success/failure.
+#
+#   If EXTRA-FLAGS is defined, it is added to the current language's default
+#   flags (e.g. CFLAGS) when the check is done.  The check is thus made with
+#   the flags: "CFLAGS EXTRA-FLAGS FLAG".  This can for example be used to
+#   force the compiler to issue an error when a bad flag is given.
+#
+#   NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
+#   macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#   Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
+#
+#   This program is free software: you can redistribute it and/or modify it
+#   under the terms of the GNU General Public License as published by the
+#   Free Software Foundation, either version 3 of the License, or (at your
+#   option) any later version.
+#
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+#   Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License along
+#   with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+
+#serial 2
+
+AC_DEFUN([AX_CHECK_COMPILE_FLAG],
+[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX
+AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
+AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
+  ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
+  _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
+    [AS_VAR_SET(CACHEVAR,[yes])],
+    [AS_VAR_SET(CACHEVAR,[no])])
+  _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
+AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes],
+  [m4_default([$2], :)],
+  [m4_default([$3], :)])
+AS_VAR_POPDEF([CACHEVAR])dnl
+])dnl AX_CHECK_COMPILE_FLAGS
Index: ax_check_flag.m4
===================================================================
--- m4/ax_check_flag.m4	(revision 82e93c95ea82cdc4725e91b4d3ac6ac4f0b75f24)
+++ 	(revision )
@@ -1,151 +1,0 @@
-# ===========================================================================
-#       http://www.gnu.org/software/autoconf-archive/ax_check_flag.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-#   AX_CHECK_PREPROC_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS])
-#   AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS])
-#   AX_CHECK_LINK_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS])
-#   AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE])
-#   AX_APPEND_COMPILE_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS])
-#   AX_APPEND_LINK_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS])
-#
-# DESCRIPTION
-#
-#   Check whether the given FLAG works with the current language's
-#   preprocessor/compiler/linker, or whether they give an error. (Warnings,
-#   however, are ignored.)
-#
-#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
-#   success/failure.
-#
-#   If EXTRA-FLAGS is defined, it is added to the current language's default
-#   flags (e.g.  CFLAGS) when the check is done.  The check us thus made
-#   with the following flags: "CFLAGS EXTRA-FLAGS FLAG".  EXTRA-FLAGS can
-#   for example be used to force the compiler to issue an error when a bad
-#   flag is given.
-#
-#   AX_APPEND_FLAG appends the FLAG to the FLAG-VARIABLE shell variable or
-#   the current language's flags if not specified.  FLAG is not added to
-#   FLAG-VARIABLE if it is already in the shell variable.
-#
-#   AX_APPEND_COMPILE_FLAGS checks for each FLAG1, FLAG2, etc. using
-#   AX_CHECK_COMPILE_FLAG and if the check is successful the flag is added
-#   to the appropriate FLAGS variable with AX_APPEND_FLAG.  The
-#   FLAGS-VARIABLE and EXTRA-FLAGS arguments are the same as in the other
-#   macros. AX_APPEND_LINK_FLAGS does the same for linker flags.
-#
-#   NOTE: Based on AX_CHECK_COMPILER_FLAGS and AX_CFLAGS_GCC_OPTION.
-#
-# LICENSE
-#
-#   Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
-#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
-#   Copyright (c) 2009 Matteo Frigo
-#   Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
-#
-#   This program is free software: you can redistribute it and/or modify it
-#   under the terms of the GNU General Public License as published by the
-#   Free Software Foundation, either version 3 of the License, or (at your
-#   option) any later version.
-#
-#   This program is distributed in the hope that it will be useful, but
-#   WITHOUT ANY WARRANTY; without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
-#   Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License along
-#   with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-#   As a special exception, the respective Autoconf Macro's copyright owner
-#   gives unlimited permission to copy, distribute and modify the configure
-#   scripts that are the output of Autoconf when processing the Macro. You
-#   need not follow the terms of the GNU General Public License when using
-#   or distributing such scripts, even though portions of the text of the
-#   Macro appear in them. The GNU General Public License (GPL) does govern
-#   all other use of the material that constitutes the Autoconf Macro.
-#
-#   This special exception to the GPL applies to versions of the Autoconf
-#   Macro released by the Autoconf Archive. When you make and distribute a
-#   modified version of the Autoconf Macro, you may extend this special
-#   exception to the GPL to apply to your modified version as well.
-
-#serial 3
-
-AC_DEFUN([AX_CHECK_PREPROC_FLAG],
-[AC_PREREQ(2.59) dnl for _AC_LANG_PREFIX
-AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]cppflags_$4_$1])dnl
-AC_CACHE_CHECK([whether _AC_LANG preprocessor accepts $1], CACHEVAR, [
-  ax_check_save_flags=$CPPFLAGS
-  CPPFLAGS="$CPPFLAGS $4 $1"
-  AC_PREPROC_IFELSE([AC_LANG_PROGRAM()],
-    [AS_VAR_SET(CACHEVAR,[yes])],
-    [AS_VAR_SET(CACHEVAR,[no])])
-  CPPFLAGS=$ax_check_save_flags])
-AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes],
-  [m4_default([$2], :)],
-  [m4_default([$3], :)])
-AS_VAR_POPDEF([CACHEVAR])dnl
-])dnl AX_CHECK_PREPROC_FLAGS
-
-AC_DEFUN([AX_CHECK_COMPILE_FLAG],
-[AC_PREREQ(2.59) dnl for _AC_LANG_PREFIX
-AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
-AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
-  ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
-  _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
-  AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
-    [AS_VAR_SET(CACHEVAR,[yes])],
-    [AS_VAR_SET(CACHEVAR,[no])])
-  _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
-AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes],
-  [m4_default([$2], :)],
-  [m4_default([$3], :)])
-AS_VAR_POPDEF([CACHEVAR])dnl
-])dnl AX_CHECK_COMPILE_FLAGS
-
-AC_DEFUN([AX_CHECK_LINK_FLAG],
-[AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_ldflags_$4_$1])dnl
-AC_CACHE_CHECK([whether the linker accepts $1], CACHEVAR, [
-  ax_check_save_flags=$LDFLAGS
-  LDFLAGS="$LDFLAGS $4 $1"
-  AC_LINK_IFELSE([AC_LANG_PROGRAM()],
-    [AS_VAR_SET(CACHEVAR,[yes])],
-    [AS_VAR_SET(CACHEVAR,[no])])
-  LDFLAGS=$ax_check_save_flags])
-AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes],
-  [m4_default([$2], :)],
-  [m4_default([$3], :)])
-AS_VAR_POPDEF([CACHEVAR])dnl
-])dnl AX_CHECK_LINK_FLAGS
-
-
-AC_DEFUN([AX_APPEND_FLAG],
-[AC_PREREQ(2.59) dnl for _AC_LANG_PREFIX
-AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])])dnl
-AS_VAR_SET_IF(FLAGS,
-  [case " AS_VAR_GET(FLAGS) " in
-    *" $1 "*)
-      AC_RUN_LOG([: FLAGS already contains $1])
-      ;;
-    *)
-      AC_RUN_LOG([: FLAGS="$FLAGS $1"])
-      AS_VAR_SET(FLAGS, ["AS_VAR_GET(FLAGS) $1"])
-      ;;
-   esac],
-  [AS_VAR_SET(FLAGS,["$1"])])
-AS_VAR_POPDEF([FLAGS])dnl
-])dnl AX_APPEND_FLAG
-
-AC_DEFUN([AX_APPEND_COMPILE_FLAGS],
-[for flag in $1; do
-  AX_CHECK_COMPILE_FLAG([$flag], [AX_APPEND_FLAG([$flag], [$2])], [], [$3])
-done
-])dnl AX_APPEND_COMPILE_FLAGS
-
-AC_DEFUN([AX_APPEND_LINK_FLAGS],
-[for flag in $1; do
-  AX_CHECK_LINK_FLAG([$flag], [AX_APPEND_FLAG([$flag], [m4_default([$2], [LDFLAGS])])], [], [$3])
-done
-])dnl AX_APPEND_LINK_FLAGS
Index: m4/pkg.m4
===================================================================
--- m4/pkg.m4	(revision 650fb2c030491f5d6668ad439b83a6a6b7b9870e)
+++ m4/pkg.m4	(revision 13a39ae85b50a361ce1f1c27746d66e2d1470649)
@@ -158,2 +158,57 @@
 fi[]dnl
 ])# PKG_CHECK_MODULES
+
+
+# PKG_INSTALLDIR(DIRECTORY)
+# -------------------------
+# Substitutes the variable pkgconfigdir as the location where a module
+# should install pkg-config .pc files. By default the directory is
+# $libdir/pkgconfig, but the default can be changed by passing
+# DIRECTORY. The user can override through the --with-pkgconfigdir
+# parameter.
+AC_DEFUN([PKG_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+    [pkg-config installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([pkgconfigdir],
+    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
+    [with_pkgconfigdir=]pkg_default)
+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+]) dnl PKG_INSTALLDIR
+
+
+# PKG_NOARCH_INSTALLDIR(DIRECTORY)
+# -------------------------
+# Substitutes the variable noarch_pkgconfigdir as the location where a
+# module should install arch-independent pkg-config .pc files. By
+# default the directory is $datadir/pkgconfig, but the default can be
+# changed by passing DIRECTORY. The user can override through the
+# --with-noarch-pkgconfigdir parameter.
+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([noarch-pkgconfigdir],
+    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
+    [with_noarch_pkgconfigdir=]pkg_default)
+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+]) dnl PKG_NOARCH_INSTALLDIR
+
+
+# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# -------------------------------------------
+# Retrieves the value of the pkg-config variable for the given module.
+AC_DEFUN([PKG_CHECK_VAR],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
+
+_PKG_CONFIG([$1], [variable="][$3]["], [$2])
+AS_VAR_COPY([$1], [pkg_cv_][$1])
+
+AS_VAR_IF([$1], [""], [$5], [$4])dnl
+])# PKG_CHECK_VAR
Index: owl.h
===================================================================
--- owl.h	(revision bbc31e47b279ccc502d0452ffed590280f0527d6)
+++ owl.h	(revision 6249a88f828fc12fc0fc17905474a3de4efcd3e8)
@@ -10,5 +10,5 @@
 #define INC_BARNOWL_OWL_H
 
-#include "config.h"
+#include <config.h>
 
 #include "compat/compat.h"
@@ -608,5 +608,5 @@
 extern owl_global g;
 
-#include "owl_prototypes.h"
+#include <owl_prototypes.h>
 
 /* These were missing from the Zephyr includes before Zephyr 3. */
Index: perl/Makefile.am
===================================================================
--- perl/Makefile.am	(revision 10557e655b3e9d7d904e1c92e4e79e331de9c01f)
+++ perl/Makefile.am	(revision a870319fe18d430bc48c613c86d8c3203e094ed7)
@@ -1,1 +1,31 @@
 SUBDIRS = modules
+nobase_dist_pkgdata_DATA = \
+	lib/BarnOwl.pm \
+	lib/BarnOwl/Complete/AIM.pm \
+	lib/BarnOwl/Complete/Client.pm \
+	lib/BarnOwl/Complete/Filter.pm \
+	lib/BarnOwl/Complete/Zephyr.pm \
+	lib/BarnOwl/Completion.pm \
+	lib/BarnOwl/Completion/Context.pm \
+	lib/BarnOwl/Completion/Util.pm \
+	lib/BarnOwl/Editwin.pm \
+	lib/BarnOwl/Help.pm \
+	lib/BarnOwl/Hook.pm \
+	lib/BarnOwl/Hooks.pm \
+	lib/BarnOwl/MainLoopCompatHook.pm \
+	lib/BarnOwl/Message.pm \
+	lib/BarnOwl/Message/AIM.pm \
+	lib/BarnOwl/Message/Admin.pm \
+	lib/BarnOwl/Message/Generic.pm \
+	lib/BarnOwl/Message/Loopback.pm \
+	lib/BarnOwl/Message/Zephyr.pm \
+	lib/BarnOwl/ModuleLoader.pm \
+	lib/BarnOwl/Parse.pm \
+	lib/BarnOwl/Style.pm \
+	lib/BarnOwl/Style/Basic.pm \
+	lib/BarnOwl/Style/Default.pm \
+	lib/BarnOwl/Style/Legacy.pm \
+	lib/BarnOwl/Style/OneLine.pm \
+	lib/BarnOwl/Timer.pm \
+	lib/BarnOwl/Zephyr.pm \
+	lib/Module/Install/BarnOwl.pm
Index: perl/modules/Makefile.am
===================================================================
--- perl/modules/Makefile.am	(revision 35c5bd8239d45703bce2d58372712cdcaa78bd82)
+++ perl/modules/Makefile.am	(revision eb5e8fc6ce7cdd350be66aa869a84308ead60382)
@@ -2,4 +2,8 @@
 
 EXTRA_DIST = $(MODULES:=/Makefile.PL) $(MODULES:=/inc) $(MODULES:=/lib)
+EXTRA_DIST += \
+    Facebook/README \
+    Twitter/README \
+    Twitter/twitter.example
 
 all-local: $(MODULES)
@@ -9,4 +13,5 @@
 MODULES_MAKEFILE = $(MODULES:=/Makefile)
 $(MODULES_MAKEFILE): %/Makefile: %/Makefile.PL
+	[ $(srcdir) = . ] || cp -srf --no-preserve=mode -- $(abs_srcdir)/$*/. $*
 	$(AM_V_GEN)(cd $* && perl -I../../lib Makefile.PL)
 
@@ -14,5 +19,10 @@
 clean-local: $(MODULES_CLEAN)
 $(MODULES_CLEAN): clean_%:
-	(cd $* && (test ! -f Makefile || $(MAKE) clean))
+	if [ $(srcdir) = . ]; then \
+	    (cd $* && { test ! -f Makefile || $(MAKE) realclean; }) && \
+	    rm -f $*/$*.par; \
+	else \
+	    rm -rf $*; \
+	fi
 
 MODULES_INSTALL = $(MODULES:%=module_install_%)
@@ -23,3 +33,6 @@
 	${INSTALL_DATA} $*/$*.par ${DESTDIR}${pkgdatadir}/modules/$*.par
 
+uninstall-local:
+	rm -f $(MODULES:%=${DESTDIR}${pkgdatadir}/modules/%.par)
+
 .PHONY: $(MODULES) $(MODULES_CLEAN) $(MODULES_INSTALL)
Index: runtests.sh
===================================================================
--- runtests.sh	(revision f6ab6ee703220c4fbafada73532fbcdc3454705a)
+++ runtests.sh	(revision 5db8835abc234293110e218bb062b27abaddf399)
@@ -1,2 +1,2 @@
 #!/bin/sh
-exec env HARNESS_PERL=./tester prove --failures t/
+exec env HARNESS_PERL=./tester prove --failures "${srcdir:=$(dirname "$0")}/t/"
Index: t/00-core-tests.t
===================================================================
--- t/00-core-tests.t	(revision 95414bfd3960e215dd54e6916a12f56abbf0c820)
+++ t/00-core-tests.t	(revision 5db8835abc234293110e218bb062b27abaddf399)
@@ -1,3 +1,2 @@
 #!/usr/bin/env perl
-use File::Basename;
-system(dirname($0) . "/../tester", "--builtin");
+system("./tester", "--builtin");
Index: ster
===================================================================
--- tester	(revision de18326f12c18fd92f275bf46bca509343b79063)
+++ 	(revision )
@@ -1,1 +1,0 @@
-barnowl
Index: zcrypt.c
===================================================================
--- zcrypt.c	(revision d72ba1e6f5395eb40aefdd154fa6db8e3a0b5d3c)
+++ zcrypt.c	(revision 6249a88f828fc12fc0fc17905474a3de4efcd3e8)
@@ -17,5 +17,5 @@
 #include <ctype.h>
 
-#include "config.h"
+#include <config.h>
 
 #ifdef HAVE_KERBEROS_IV
Index: zephyr.c
===================================================================
--- zephyr.c	(revision bbe7d4a8ffa8c6c6b49ff192f54df4c385dfc1cb)
+++ zephyr.c	(revision 89f01bd9823da865a9b70dc55e7910ef2944fb0a)
@@ -742,5 +742,4 @@
   /* free then check the return */
   g_free(notice.z_message);
-  ZFreeNotice(&notice);
   g_free(zsender);
   if (ret != ZERR_NONE) {
