DarwinPorts is a great project, but I hate using when I don't have to. Mac OS X (at least Tiger does) comes with a readline compatibity already installed - so I have updated these instructions so that you can create a java-readline installation WITHOUT installing DarwinPorts.
The steps are a bit more involved...but here they are:
Download the libreadline-java source from the project site.
Unpackage.
In the source root, edit
Makefile and make the following changes:- Add
JAVA_HOME = /Library/Java/Homebelow the line# Operating system dependent - Make the
JAVANATINCvariable read$(JAVA_HOME)/include - Change
LD_LIBRARY_PATHto beDYLD_LIBRARY_PATH
Now, edit
src/native/Makefile and change the following:- Change the
LIBPATHvariable to be empty - Change the
CFLAGSto-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc -fno-common -DMAC_OS - Change
$(CC) -shared (OBJECTS) $(LIBPATH) $($(TG)_LIBS) -o $@to$(CC) -bundle -flat_namespace -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc $(OBJECTS) $(LIBPATH) $($(TG)_LIBS) -o $@ - change the
JavaReadline_LIBSvariable to be-lreadline -ltermcap
Now, you need to edit
src/native/org_gnu_readline_Readline.c and make the following changes:- On lines 98, 114, 213, and 224, change
#ifdef JavaReadlineto#if defined JavaReadline && !defined MAC_OS - On lines 216, 235, and 475, change
#ifdef JavaEditlineto#if defined JavaEditline || defined MAC_OS
Now, you can run
make, and you will end up with libJavaReadline.so and libreadline-java.jar.Rename
libJavaReadline.so to libJavaReadline.jnilib.Move
libJavaReadline.jnilib and libreadline-java.jar to /Library/Java/Extensions to install it and have it available to all java processes.To test, run
java test.ReadlineTest from the command line.Have fun! Now, you can install HenPlus on Mac OS X easily!
If you are lazy, you can try out the pre-compiled binaries that I have available here - after unzipping, just move the two files (not the entire folder) into your
/Library/Java/Extensions directory. NOTE: these *may* only work on OS X 10.4 and up - I have only tested them on that platform, and they are *not* universal binaries - PPC only.
