Index: configure
===================================================================
--- configure	(revision 884c2720374c369770473f98104271e72e86b2ce)
+++ configure	(revision be0a79f9aaeb37a5353c2e701b12ecb9eccc7366)
@@ -1380,9 +1380,8 @@
 else
   echo "$ac_t""no" 1>&6
-{ echo "configure: error: No zephyr library found." 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking for ZInitLocationInfo in -lzephyr""... $ac_c" 1>&6
-echo "configure:1387: checking for ZInitLocationInfo in -lzephyr" >&5
+echo "configure:1386: checking for ZInitLocationInfo in -lzephyr" >&5
 ac_lib_var=`echo zephyr'_'ZInitLocationInfo | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
@@ -1392,5 +1391,5 @@
 LIBS="-lzephyr  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1395 "configure"
+#line 1394 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -1403,5 +1402,5 @@
 ; return 0; }
 EOF
-if { (eval echo configure:1406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
@@ -1430,10 +1429,10 @@
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1433: checking for $ac_func" >&5
+echo "configure:1432: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1438 "configure"
+#line 1437 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
@@ -1458,5 +1457,5 @@
 ; return 0; }
 EOF
-if { (eval echo configure:1461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
@@ -1484,7 +1483,7 @@
 
 echo $ac_n "checking for des_ecb_encrypt prototype""... $ac_c" 1>&6
-echo "configure:1487: checking for des_ecb_encrypt prototype" >&5
+echo "configure:1486: checking for des_ecb_encrypt prototype" >&5
 cat > conftest.$ac_ext <<EOF
-#line 1489 "configure"
+#line 1488 "configure"
 #include "confdefs.h"
 #include <des.h>
@@ -1494,5 +1493,5 @@
 ; return 0; }
 EOF
-if { (eval echo configure:1497: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1496: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_des_ecb_encrypt_proto=no
@@ -1514,5 +1513,5 @@
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1517: checking how to run the C preprocessor" >&5
+echo "configure:1516: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
@@ -1529,5 +1528,5 @@
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1532 "configure"
+#line 1531 "configure"
 #include "confdefs.h"
 #include <assert.h>
@@ -1535,5 +1534,5 @@
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1538: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1537: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
@@ -1546,5 +1545,5 @@
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1549 "configure"
+#line 1548 "configure"
 #include "confdefs.h"
 #include <assert.h>
@@ -1552,5 +1551,5 @@
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1555: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1554: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
@@ -1563,5 +1562,5 @@
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 1566 "configure"
+#line 1565 "configure"
 #include "confdefs.h"
 #include <assert.h>
@@ -1569,5 +1568,5 @@
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1572: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1571: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
@@ -1594,10 +1593,10 @@
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1597: checking for ANSI C header files" >&5
+echo "configure:1596: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1602 "configure"
+#line 1601 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
@@ -1607,5 +1606,5 @@
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1610: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1609: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
@@ -1624,5 +1623,5 @@
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1627 "configure"
+#line 1626 "configure"
 #include "confdefs.h"
 #include <string.h>
@@ -1642,5 +1641,5 @@
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1645 "configure"
+#line 1644 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
@@ -1663,5 +1662,5 @@
 else
   cat > conftest.$ac_ext <<EOF
-#line 1666 "configure"
+#line 1665 "configure"
 #include "confdefs.h"
 #include <ctype.h>
@@ -1674,5 +1673,5 @@
 
 EOF
-if { (eval echo configure:1677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
@@ -1698,10 +1697,10 @@
 
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:1701: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:1700: checking for sys/wait.h that is POSIX.1 compatible" >&5
 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1706 "configure"
+#line 1705 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
@@ -1719,5 +1718,5 @@
 ; return 0; }
 EOF
-if { (eval echo configure:1722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1721: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
@@ -1743,15 +1742,15 @@
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1746: checking for $ac_hdr" >&5
+echo "configure:1745: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1751 "configure"
+#line 1750 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1756: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1755: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
@@ -1785,5 +1784,5 @@
 
 echo $ac_n "checking for the perl xsubpp precompiler""... $ac_c" 1>&6
-echo "configure:1788: checking for the perl xsubpp precompiler" >&5
+echo "configure:1787: checking for the perl xsubpp precompiler" >&5
 XSUBPPDIR="`(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
@@ -1800,5 +1799,5 @@
 ac_safe=`echo "/usr/share/terminfo" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for /usr/share/terminfo""... $ac_c" 1>&6
-echo "configure:1803: checking for /usr/share/terminfo" >&5
+echo "configure:1802: checking for /usr/share/terminfo" >&5
 if eval "test \"`echo '$''{'ac_cv_file_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1825,5 +1824,5 @@
 ac_safe=`echo "/usr/share/lib/terminfo" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for /usr/share/lib/terminfo""... $ac_c" 1>&6
-echo "configure:1828: checking for /usr/share/lib/terminfo" >&5
+echo "configure:1827: checking for /usr/share/lib/terminfo" >&5
 if eval "test \"`echo '$''{'ac_cv_file_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1886,5 +1885,5 @@
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1889: checking for a BSD compatible install" >&5
+echo "configure:1888: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
Index: configure.in
===================================================================
--- configure.in	(revision 884c2720374c369770473f98104271e72e86b2ce)
+++ configure.in	(revision be0a79f9aaeb37a5353c2e701b12ecb9eccc7366)
@@ -41,5 +41,6 @@
 AC_CHECK_LIB(krb4, krb_sendauth,,
    AC_CHECK_LIB(krb, krb_sendauth))
-AC_CHECK_LIB(zephyr, ZGetSender,, AC_MSG_ERROR(No zephyr library found.))
+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]),)
 
Index: message.c
===================================================================
--- message.c	(revision f14a7eecad062a5aec6bf7030b8d369c19ac4aa8)
+++ message.c	(revision be0a79f9aaeb37a5353c2e701b12ecb9eccc7366)
@@ -425,8 +425,10 @@
 }
 
+#ifdef HAVE_LIBZEPHYR
 ZNotice_t *owl_message_get_notice(owl_message *m)
 {
   return(&(m->notice));
 }
+#endif
 
 char *owl_message_get_hostname(owl_message *m)
Index: owl.c
===================================================================
--- owl.c	(revision c3ab15523776ccb541f069f3baf038b15e3627bc)
+++ owl.c	(revision be0a79f9aaeb37a5353c2e701b12ecb9eccc7366)
@@ -41,4 +41,5 @@
   struct tm *today;
   char *dir;
+  ZNotice_t notice;
 
   argcsave=argc;
@@ -89,14 +90,12 @@
   }
 
+#ifdef HAVE_LIBZEPHYR
   /* zephyr init */
-  if ((ret = ZInitialize()) != ZERR_NONE) {
-    com_err("owl",ret,"while initializing");
+  ret=owl_zephyr_initialize();
+  if (ret) {
     exit(1);
   }
-  if ((ret = ZOpenPort(NULL)) != ZERR_NONE) {
-    com_err("owl",ret,"while opening port");
-    exit(1);
-  }
-
+#endif
+  
   /* signal handler */
   sigact.sa_handler=sig_handler;
@@ -336,6 +335,5 @@
     newmsgs=0;
     zpendcount=0;
-    while(ZPending() || owl_global_messagequeue_pending(&g)) {
-      ZNotice_t notice;
+    while(owl_zephyr_zpending() || owl_global_messagequeue_pending(&g)) {
       struct sockaddr_in from;
       owl_message *m;
@@ -343,5 +341,5 @@
       
       /* grab the new message, stick it in 'm' */
-      if (ZPending()) {
+      if (owl_zephyr_zpending()) {
 	/* grab a zephyr notice, but if we've done 20 without stopping,
 	   take a break to process keystrokes etc. */
Index: owl.h
===================================================================
--- owl.h	(revision c3ab15523776ccb541f069f3baf038b15e3627bc)
+++ owl.h	(revision be0a79f9aaeb37a5353c2e701b12ecb9eccc7366)
@@ -2,5 +2,4 @@
 #define INC_OWL_H
 
-#include <zephyr/zephyr.h>
 #include <curses.h>
 #include <sys/param.h>
@@ -11,4 +10,8 @@
 #include <libfaim/aim.h>
 #include "config.h"
+#ifdef HAVE_LIBZEPHYR
+#include <zephyr/zephyr.h>
+#endif
+
 
 static const char owl_h_fileIdent[] = "$Id$";
@@ -247,5 +250,7 @@
   int type;
   int direction;
+#ifdef HAVE_LIBZEPHYR
   ZNotice_t notice;
+#endif
   owl_fmtext fmtext;              /* this is now only a CACHED copy */
   int invalid_format;             /* indicates whether fmtext needs to be regenerated */
@@ -441,6 +446,8 @@
 
 /* these are missing from the zephyr includes for some reason */
+#ifdef HAVE_LIBZEPHYR
 int ZGetSubscriptions(ZSubscription_t *, int *);
 int ZGetLocations(ZLocations_t *,int *);
+#endif
 
 #endif /* INC_OWL_H */
Index: zephyr.c
===================================================================
--- zephyr.c	(revision 65ad0739d37ef1c668cb1440cc31a672f39d7246)
+++ zephyr.c	(revision be0a79f9aaeb37a5353c2e701b12ecb9eccc7366)
@@ -12,6 +12,31 @@
 Code_t ZResetAuthentication();
 
+int owl_zephyr_initialize()
+{
+  int ret;
+  
+  if ((ret = ZInitialize()) != ZERR_NONE) {
+    com_err("owl",ret,"while initializing");
+    return(1);
+  }
+  if ((ret = ZOpenPort(NULL)) != ZERR_NONE) {
+    com_err("owl",ret,"while opening port");
+    return(1);
+  }
+  return(0);
+}
+
+int owl_zephyr_zpending()
+{
+#ifdef HAVE_LIBZEPHYR
+  return(ZPending());
+#else
+  return(0);
+#endif
+}
+
 int owl_zephyr_loadsubs(char *filename)
 {
+#ifdef HAVE_LIBZEPHYR
   /* return 0  on success
    *        -1 on file error
@@ -83,8 +108,12 @@
 
   return(ret);
+#else
+  return(0);
+#endif
 }
 
 int owl_zephyr_loadloginsubs(char *filename)
 {
+#ifdef HAVE_LIBZEPHYR
   FILE *file;
   ZSubscription_t subs[3001];
@@ -139,8 +168,12 @@
 
   return(ret);
+#else
+  return(0);
+#endif
 }
 
 void unsuball()
 {
+#if HAVE_LIBZEPHYR
   int ret;
 
@@ -150,8 +183,10 @@
     com_err("owl",ret,"while unsubscribing");
   }
+#endif
 }
 
 int owl_zephyr_sub(char *class, char *inst, char *recip)
 {
+#ifdef HAVE_LIBZEPHYR
   ZSubscription_t subs[5];
   int ret;
@@ -167,4 +202,7 @@
   }
   return(0);
+#else
+  return(0);
+#endif
 }
 
@@ -172,4 +210,5 @@
 int owl_zephyr_unsub(char *class, char *inst, char *recip)
 {
+#ifdef HAVE_LIBZEPHYR
   ZSubscription_t subs[5];
   int ret;
@@ -185,7 +224,10 @@
   }
   return(0);
-}
-
-
+#else
+  return(0);
+#endif
+}
+
+#ifdef HAVE_LIBZEPHYR
 char *owl_zephyr_get_field(ZNotice_t *n, int j, int *k)
 {
@@ -216,6 +258,7 @@
   return("");
 }
-
-
+#endif
+
+#ifdef HAVE_LIBZEPHYR
 int owl_zephyr_get_num_fields(ZNotice_t *n)
 {
@@ -229,6 +272,7 @@
   return(fields);
 }
-
-
+#endif
+
+#ifdef HAVE_LIBZEPHYR
 char *owl_zephyr_get_message(ZNotice_t *n, int *k)
 {
@@ -241,6 +285,7 @@
   return(owl_zephyr_get_field(n, 2, k));
 }
-
-
+#endif
+
+#ifdef HAVE_LIBZEPHYR
 char *owl_zephyr_get_zsig(ZNotice_t *n, int *k)
 {
@@ -254,8 +299,9 @@
   return(n->z_message);
 }
-
+#endif
 
 int send_zephyr(char *opcode, char *zsig, char *class, char *instance, char *recipient, char *message)
 {
+#ifdef HAVE_LIBZEPHYR
   int ret;
   ZNotice_t notice;
@@ -293,18 +339,25 @@
     return(ret);
   }
-
-  return(0);
-}
-
+  return(0);
+#else
+  return(0);
+#endif
+}
+
+#ifdef HAVE_LIBZEPHYR
 Code_t send_zephyr_helper(ZNotice_t *notice, char *buf, int len, int wait)
 {
   return(ZSendPacket(buf, len, 0));
 }
+#endif
 
 void send_ping(char *to)
 {
+#ifdef HAVE_LIBZEPHYR
   send_zephyr("PING", "", "MESSAGE", "PERSONAL", to, "");
-}
-
+#endif
+}
+
+#ifdef HAVE_LIBZEPHYR
 void owl_zephyr_handle_ack(ZNotice_t *retnotice)
 {
@@ -343,5 +396,7 @@
   }
 }
-
+#endif
+
+#ifdef HAVE_LIBZEPHYR
 int owl_zephyr_notice_is_ack(ZNotice_t *n)
 {
@@ -352,7 +407,9 @@
   return(0);
 }
+#endif
   
 void owl_zephyr_zaway(owl_message *m)
 {
+#ifdef HAVE_LIBZEPHYR
   char *tmpbuff, *myuser, *to;
   
@@ -392,7 +449,8 @@
   owl_function_make_outgoing_zephyr(owl_global_get_zaway_msg(&g), tmpbuff, "Automated reply:");
   owl_free(tmpbuff);
-}
-
-
+#endif
+}
+
+#ifdef HAVE_LIBZEPHYR
 void owl_zephyr_hackaway_cr(ZNotice_t *n)
 {
@@ -406,7 +464,9 @@
   }
 }
+#endif
 
 void owl_zephyr_zlocate(char *user, char *out, int auth)
 {
+#ifdef HAVE_LIBZEPHYR
   int ret, numlocs;
   int one = 1;
@@ -434,8 +494,10 @@
     owl_free(myuser);
   }
+#endif
 }
 
 void owl_zephyr_addsub(char *filename, char *class, char *inst, char *recip)
 {
+#ifdef HAVE_LIBZEPHYR
   char *line, subsfile[LINE], buff[LINE];
   FILE *file;
@@ -477,8 +539,10 @@
   
   owl_free(line);
+#endif
 }
 
 void owl_zephyr_delsub(char *filename, char *class, char *inst, char *recip)
 {
+#ifdef HAVE_LIBZEPHYR
   char *line, subsfile[LINE], buff[LINE], *text;
   char backupfilename[LINE];
@@ -544,4 +608,5 @@
 
   owl_function_makemsg("Subscription removed");
+#endif
 }
 
@@ -559,4 +624,5 @@
 void owl_zephyr_zlog_in(void)
 {
+#ifdef HAVE_LIBZEPHYR
   char *exposure, *eset;
   int ret;
@@ -590,8 +656,10 @@
     */
   }
+#endif
 }
 
 void owl_zephyr_zlog_out(void)
 {
+#ifdef HAVE_LIBZEPHYR
   int ret;
 
@@ -605,4 +673,5 @@
     */
   }
+#endif
 }
 
