[117] in bug-owl

home help back first fref pref prev next nref lref last post

Getting owl to work on OS X

daemon@ATHENA.MIT.EDU (Tara L Andrews)
Fri Jan 24 04:30:22 2003

Date: Fri, 24 Jan 2003 04:29:11 -0500
From: Tara L Andrews <taralee@alum.mit.edu>
To: bug-owl@mit.edu
Message-ID: <20030124092911.GA28265@elliptical.eccentricity.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="huq684BweRXVnRxX"
Content-Disposition: inline


--huq684BweRXVnRxX
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi,

Following is a list of mods I had to make in order to make owl compile
on OS X.

There were a few main issues.  The first was that the header malloc.h
is in the subdir "sys" on OS X, so the #include in util.c had to be
modified.  I did that via a change to configure.in.  I noticed along
the way that the configure.in which came with the tarball causes
autoheader to barf, so I fixed it.  (That last isn't an OS X issue
either; running autoheader on that configure.in also failed on Linux.)

The second issue is that for some wildly bizarre reason that I can't
figure out, ld has issues with libzephyr.a compiled on OS X such that
symbols in the library mysteriously show up as undefined.  I couldn't
figure out how to code my workaround into configure.in, so the patch
I'm sending directly patches configure.  I know this is bad, but I
don't have a better solution until someone with serious ld clue takes
a look at the libzephyr problem.

The third issue is that ld on the Mac doesn't like the fact that the
statement
owl_global g;
is included into every .c file without being declared extern and
initialized somewhere.  It thinks that there are multiple symbols by
the same name, and barfs.  So I extern'd the declaration in owl.h, and
added definitions to owl.c and tester.c.  That fixed the problem.

The fourth issue is that gcc on the Mac died on zcrypt.c because of
the re-declaration of the function des_ecb_encrypt().  I commented out
the re-declaration and it worked fine, albeit with a few "incompatible
pointer type" warnings (very similar to the ones all over the place
when I compile zephyr.)

So I think the patch I'm including is explained.  The offsets for the
patch to configure are going to be wrong, what with re-running
autoconf before I made the diff.  If y'all discuss this further,
remember that I'm not on the list. :)

-tara

--huq684BweRXVnRxX
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="diff.owl"

diff -u -r owl-1.2.7/configure owl-1.2.7-macosx/configure
--- owl-1.2.7/configure Thu Oct 17 15:41:34 2002
+++ owl-1.2.7-macosx/configure   Fri Jan 24 04:26:46 2003
@@ -1206,9 +1206,11 @@
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
+char ZCancelSubscriptions(int);
 char ZGetSender();
 
 int main() {
+ZCancelSubscriptions(0);
 ZGetSender()
 ; return 0; }
 EOF
diff -u -r owl-1.2.7/configure.in owl-1.2.7-macosx/configure.in
--- owl-1.2.7/configure.in	Thu Oct 17 15:41:34 2002
+++ owl-1.2.7-macosx/configure.in	Tue Jan 21 18:01:30 2003
@@ -37,12 +37,16 @@
 AC_CHECK_LIB(krb5, krb5_get_credentials)
 AC_CHECK_LIB(krb4, krb_sendauth)
 AC_CHECK_LIB(zephyr, ZGetSender,, AC_MSG_ERROR(No zephyr library found.))
-AC_CHECK_LIB(zephyr, ZInitLocationInfo, AC_DEFINE(HAVE_LIBZEPHYR_ZINITLOCATIONINFO),)
+AC_CHECK_LIB(zephyr, ZInitLocationInfo, AC_DEFINE(HAVE_LIBZEPHYR_ZINITLOCATIONINFO,,Define if libzephyr contains ZInitLocationInfo.),)
 
 dnl Checks for header files.
 AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
 AC_CHECK_HEADERS(strings.h sys/ioctl.h unistd.h)
+dnl Find a malloc somewhere on the system
+AC_CHECK_HEADER(malloc.h, AC_DEFINE(HAVE_MALLOC_H,,Define if you have the <malloc.h> header file.),
+  AC_CHECK_HEADER(sys/malloc.h, AC_DEFINE(HAVE_SYS_MALLOC_H,,Define if you have the <malloc.h> header file.),
+    AC_MSG_ERROR(No malloc library found.)))
 
 dnl Add CFLAGS for embeded perl
 FOO=`perl -MExtUtils::Embed -e ccopts`
@@ -64,8 +68,8 @@
 LDFLAGS=${LDFLAGS}\ ${FOO}
 
 dnl Checks for typedefs, structures, and compiler characteristics.
-AC_CHECK_FILE(/usr/share/terminfo, AC_DEFINE(TERMINFO, "/usr/share/terminfo"),
-  AC_CHECK_FILE(/usr/share/lib/terminfo, AC_DEFINE(TERMINFO, "/usr/share/lib/terminfo"),
+AC_CHECK_FILE(/usr/share/terminfo, AC_DEFINE(TERMINFO, "/usr/share/terminfo", Location of terminfo file.),
+  AC_CHECK_FILE(/usr/share/lib/terminfo, AC_DEFINE(TERMINFO, "/usr/share/lib/terminfo", Location of terminfo file.),
   AC_MSG_ERROR(No terminfo found for this system)))
 
 dnl Checks for library functions.
diff -u -r owl-1.2.7/owl.c owl-1.2.7-macosx/owl.c
--- owl-1.2.7/owl.c	Thu Oct 17 15:41:34 2002
+++ owl-1.2.7-macosx/owl.c	Tue Jan 21 15:19:33 2003
@@ -25,6 +25,9 @@
 #include <errno.h>
 #include "owl.h"
 
+/* define our global */
+owl_global g;
+
 static const char fileIdent[] = "$Id: owl.c,v 1.13 2002/10/12 03:56:23 kretch Exp $";
 
 int main(int argc, char **argv, char **env) {
diff -u -r owl-1.2.7/owl.h owl-1.2.7-macosx/owl.h
--- owl-1.2.7/owl.h	Thu Oct 17 15:41:34 2002
+++ owl-1.2.7-macosx/owl.h	Tue Jan 21 15:19:18 2003
@@ -394,7 +394,7 @@
 } owl_global;
 
 /* globals */
-owl_global g;
+extern owl_global g;
 
 #include "owl_prototypes.h"
 
diff -u -r owl-1.2.7/tester.c owl-1.2.7-macosx/tester.c
--- owl-1.2.7/tester.c	Thu Oct 17 15:41:34 2002
+++ owl-1.2.7-macosx/tester.c	Tue Jan 21 16:42:40 2003
@@ -4,6 +4,9 @@
 
 static const char fileIdent[] = "$Id: tester.c,v 1.3 2002/07/09 04:04:39 nygren Exp $";
 
+/* define our global */
+owl_global g;
+
 void screeninit() {
   char buff[1024];
   
diff -u -r owl-1.2.7/util.c owl-1.2.7-macosx/util.c
--- owl-1.2.7/util.c	Thu Oct 17 15:41:34 2002
+++ owl-1.2.7-macosx/util.c	Tue Jan 21 18:04:36 2003
@@ -2,7 +2,12 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#include <malloc.h>
+#ifdef HAVE_MALLOC_H
+  #include <malloc.h>
+#endif
+#ifdef HAVE_SYS_MALLOC_H
+  #include <sys/malloc.h>
+#endif
 #include <unistd.h>
 #include <ctype.h>
 
diff -u -r owl-1.2.7/zcrypt.c owl-1.2.7-macosx/zcrypt.c
--- owl-1.2.7/zcrypt.c	Thu Oct 17 15:41:34 2002
+++ owl-1.2.7-macosx/zcrypt.c	Tue Jan 21 16:28:18 2003
@@ -64,7 +64,7 @@
 int do_encrypt(char *keystring, int zephyr, char *class, char *instance, ZWRITEOPTIONS *zoptions, char* keyfile);
 int do_decrypt(char *keystring);
 
-int des_ecb_encrypt(char [], char [], des_key_schedule, int);
+/* int des_ecb_encrypt(char [], char [], des_key_schedule, int); */
 
 #define M_NONE            0
 #define M_ZEPHYR_ENCRYPT  1

--huq684BweRXVnRxX--

home help back first fref pref prev next nref lref last post