Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed OS X build documentation

  • Loading branch information...
commit 36fdd168703b2f37d4559f8c08d8604ff47f8de4 1 parent 98d13b4
Chris Conlon authored
Showing with 35 additions and 10 deletions.
  1. +11 −1 JavaBuild.sh
  2. +24 −9 README
12 JavaBuild.sh
View
@@ -9,15 +9,25 @@
# the setup of the development machine which this script is being run
# on.
#
+# If building on OS X:
+#
+# 1) The Java include directory is usually similar to:
+# /System/Library/Frameworks/JavaVM.framework/Versions/A/Headers
+# 2) The shared library extension should be .dylib (libgsswrapper.dylib)
+# instead of .so.
+#
# Original source developed by yaSSL (http://www.yassl.com)
#
+# Create our package directory structure
+mkdir -p edu/mit/kerberos
+
# Generate the SWIG GSS-API interface
swig -java -package edu.mit.kerberos -outdir ./edu/mit/kerberos -o gsswrapper_wrap.c gsswrapper.i
# Compile and link libgsswrapper.so
gcc -c gsswrapper_wrap.c -I/usr/lib/jvm/java-6-openjdk/include -I/usr/local/include/gssapi
-gcc -shared gsswrapper_wrap.o -L/home/myuser/kerberos/src/lib -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lkrb5support -o libgsswrapper.so
+gcc -shared gsswrapper_wrap.o -L/usr/local/lib -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lkrb5support -o libgsswrapper.so
# Build our example client and server
javac Util.java client.java server.java
33 README
View
@@ -43,7 +43,8 @@ REQUIREMENTS:
You must have SWIG installed on your development machine in order to
generate this GSS-API wrapper. To download and install SWIG, please see
-the project homepage at http://www.swig.org/.
+the project homepage at http://www.swig.org/. This project has been developed
+using SWIG versions 1.3.31 (Mac) and 1.3.40 (Linux).
To use this interface in your Android NDK application, you need to
include cross-compiled versions of the MIT Kerberos libraries for Android
@@ -59,7 +60,7 @@ platform. More detailed instructions can be found in the script comments.
===========================================================================
WRAPPER DESIGN:
-This wrapper is comprised of a few files which are used by SWIG to generate
+This wrapper contains a few files which are used by SWIG to generate
the Java GSS-API interface, namely:
gsswrapper.i
@@ -78,8 +79,8 @@ should be updated to match accordingly.
===========================================================================
BUILDING:
-The Java GSS-API interface can be built either for use in an Android
-NDK application or for use on a standard desktop environment.
+The Java GSS-API interface can be built for use in an Android NDK application
+or for use on a standard desktop environment.
Android NDK
-----------
@@ -129,10 +130,19 @@ To build this wrapper for use with the Android NDK:
Desktop Environment
-------------------
-To build both the interface and examples on a desktop environment,
+To build the GSS-API interface and examples on a desktop environment,
(1) cd to the directory containing gsswrapper.i and edit the JavaBuild.sh file
- to match your system's Java and Kerberos configuration.
+ to match your system's Java and Kerberos configuration.
+
+ NOTE: If building on OS X, the Java include directory will most likely be
+ something similar to:
+
+ /System/Library/Frameworks/JavaVM.framework/Versions/A/Headers
+
+ For OS X, you'll also need to change the extension of the shared library
+ being compiled by SWIG to .dylib (libgsswrapper.dylib) instead of .so
+ which is used by standard Linux environments.
(2) Verify that the library being loaded by the SWIG wrapper (gsswrapper.i)
is the correct one. This should be the name of the library being created
@@ -140,17 +150,22 @@ To build both the interface and examples on a desktop environment,
(3) Run ./JavaBuild.sh
- This will run the correct SWIG command, create libgsswrapper.so as well
- as generate and compile all the necessary JNI and Java files needed
- for the interface and examples.
+ This will run the correct SWIG command, create libgsswrapper.so (.dylib)
+ as well as generate and compile all the necessary JNI and Java files
+ needed for the interface and examples.
(4) Set LD_LIBRARY_PATH to include paths to the MIT Kerberos libraries on
your system as well as the location of the SWIG-generated library.
For example, something similar to:
+ Linux:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:
/home/myuser/kerberos-java-gssapi/
+ Mac:
+ export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/local/lib:
+ /Users/myuser/kerberos-java-gssapi/
+
===========================================================================
INTERFACE USAGE:
Please sign in to comment.
Something went wrong with that request. Please try again.