Skip to content

Commit

Permalink
fixed OS X build documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
cconlon committed May 9, 2012
1 parent 98d13b4 commit 36fdd16
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 10 deletions.
12 changes: 11 additions & 1 deletion JavaBuild.sh
Expand Up @@ -9,15 +9,25 @@
# the setup of the development machine which this script is being run # the setup of the development machine which this script is being run
# on. # 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) # 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 # Generate the SWIG GSS-API interface
swig -java -package edu.mit.kerberos -outdir ./edu/mit/kerberos -o gsswrapper_wrap.c gsswrapper.i swig -java -package edu.mit.kerberos -outdir ./edu/mit/kerberos -o gsswrapper_wrap.c gsswrapper.i


# Compile and link libgsswrapper.so # Compile and link libgsswrapper.so
gcc -c gsswrapper_wrap.c -I/usr/lib/jvm/java-6-openjdk/include -I/usr/local/include/gssapi 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 # Build our example client and server
javac Util.java client.java server.java javac Util.java client.java server.java
Expand Down
33 changes: 24 additions & 9 deletions README
Expand Up @@ -43,7 +43,8 @@ REQUIREMENTS:


You must have SWIG installed on your development machine in order to You must have SWIG installed on your development machine in order to
generate this GSS-API wrapper. To download and install SWIG, please see 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 To use this interface in your Android NDK application, you need to
include cross-compiled versions of the MIT Kerberos libraries for Android include cross-compiled versions of the MIT Kerberos libraries for Android
Expand All @@ -59,7 +60,7 @@ platform. More detailed instructions can be found in the script comments.
=========================================================================== ===========================================================================
WRAPPER DESIGN: 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: the Java GSS-API interface, namely:


gsswrapper.i gsswrapper.i
Expand All @@ -78,8 +79,8 @@ should be updated to match accordingly.
=========================================================================== ===========================================================================
BUILDING: BUILDING:


The Java GSS-API interface can be built either for use in an Android The Java GSS-API interface can be built for use in an Android NDK application
NDK application or for use on a standard desktop environment. or for use on a standard desktop environment.


Android NDK Android NDK
----------- -----------
Expand Down Expand Up @@ -129,28 +130,42 @@ To build this wrapper for use with the Android NDK:


Desktop Environment 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 (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) (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 is the correct one. This should be the name of the library being created
by the JavaBuild.sh script. by the JavaBuild.sh script.


(3) Run ./JavaBuild.sh (3) Run ./JavaBuild.sh


This will run the correct SWIG command, create libgsswrapper.so as well This will run the correct SWIG command, create libgsswrapper.so (.dylib)
as generate and compile all the necessary JNI and Java files needed as well as generate and compile all the necessary JNI and Java files
for the interface and examples. needed for the interface and examples.


(4) Set LD_LIBRARY_PATH to include paths to the MIT Kerberos libraries on (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. your system as well as the location of the SWIG-generated library.
For example, something similar to: For example, something similar to:


Linux:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:
/home/myuser/kerberos-java-gssapi/ /home/myuser/kerberos-java-gssapi/


Mac:
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/local/lib:
/Users/myuser/kerberos-java-gssapi/

=========================================================================== ===========================================================================
INTERFACE USAGE: INTERFACE USAGE:


Expand Down

0 comments on commit 36fdd16

Please sign in to comment.