changeset 90:8553b27a5062

Updated README and minor buld tweaks for OS X (That will probably break the Linux build (sigh)).
author Jamie Bullock <jamie@postlude.co.uk>
date Wed, 05 Sep 2007 17:44:23 +0000
parents ee7442343cf0
children 84fea00d8509
files README configure.in swig/java/Makefile.am swig/java/test.java
diffstat 4 files changed, 78 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/README	Wed Sep 05 14:50:37 2007 +0000
+++ b/README	Wed Sep 05 17:44:23 2007 +0000
@@ -36,6 +36,54 @@
 --enable-fft (to enable functions that require fftw3)
 --enable-simpletest (to build the simpletest example)
 
+Building the Python bindings
+----------------------------
+
+To build the python bindings, add to your configure flags:
+
+--enable-swig --with-python
+
+This requres additional dependencies to be resolved:
+
+swig >= 1.3
+python (with development files) >= 2.5
+
+It might work with earlier versions of Python, but this has not been tested.
+
+If you do not have the 'standard' version of Python on OS X, you might need to tell the configure script where the python library is e.g.:
+
+./configure --your-flags LDFLAGS="-L/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/config/"
+
+to find your Python library type:
+
+locate libpython
+
+Building the Java bindings
+--------------------------
+
+To build the java bindings, add to your configure flags:
+
+--enable-swig --with-java
+
+This requres additional dependencies to be resolved:
+
+swig >= 1.3
+java (with development files) >= 2.0
+
+It might work with other versions of Java, but this has not been tested.
+
+On OS X, you will probably need to set your CLASSPATH environment variable before running ./configure
+
+export CLASSPATH=/System/Library/Frameworks/JavaVM.framework/Classes/classes.jar
+
+On OS X, you also probably need to tell the configure script where to find your Java (JNI) headers.
+
+./configure --flags  CFLAGS="-I/System/Library/Frameworks/JavaVM.framework/Headers"
+
+To find out where your headers are:
+
+locate jni.h
+
 Disclaimer
 ----------
  
--- a/configure.in	Wed Sep 05 14:50:37 2007 +0000
+++ b/configure.in	Wed Sep 05 17:44:23 2007 +0000
@@ -98,21 +98,6 @@
 
 AM_CONDITIONAL(BUILD_PYTHON, test "x${with_python}" = 'xtrue')
 
-dnl Are we building with fftw?
-if [[ "$fft" = "true" ]] ; then
-    LDFLAGS="$LDFLAGS -lfftw3f"
-    AC_DEFINE([BUILD_FFT], [1], [Build the fft functions])
-    AC_CHECK_HEADER(fftw3.h, [have_fftw3_hdr=yes ], [
-    have_pd_hdr=no
-    echo
-    echo "no fftw3.h header found.  try with option --with-fftw3-dir=/path/to/fftw3/header"
-    echo
-    exit
-    ])
-fi
-
-AM_CONDITIONAL(BUILD_FFT, test "x${fft}" = 'xtrue')
-
 
 dnl are we building the simpletest example
 if [[ "$simpletest" = "true" ]] ; then
@@ -166,12 +151,16 @@
 
 if [[ "$with_java" = "true" ]] ; then
     AC_PROG_JAVAC
-    AC_JNI_INCLUDE_DIR
+    if test "$JAVAC" = "javac"
+    then
+	AC_JNI_INCLUDE_DIR
+    
 
-    for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS
-    do
-	CFLAGS="$CFLAGS -I$JNI_INCLUDE_DIR"
-    done
+	for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS
+	do
+	    CFLAGS="$CFLAGS -I$JNI_INCLUDE_DIR"
+	done
+    fi
    dnl AC_PROG_JAVAH
    dnl AC_PATH_PROG(JAVAH,javah)
 fi
@@ -184,6 +173,22 @@
 
 AM_CONDITIONAL(BUILD_SWIG, test "x${swig}" = 'xtrue')
 
+dnl Are we building with fftw?
+if [[ "$fft" = "true" ]] ; then
+    LDFLAGS="$LDFLAGS -lfftw3f"
+    AC_DEFINE([BUILD_FFT], [1], [Build the fft functions])
+    AC_CHECK_HEADER(fftw3.h, [have_fftw3_hdr=yes ], [
+    have_pd_hdr=no
+    echo
+    echo "no fftw3.h header found.  try with option --with-fftw3-dir=/path/to/fftw3/header"
+    echo
+    exit
+    ])
+fi
+
+AM_CONDITIONAL(BUILD_FFT, test "x${fft}" = 'xtrue')
+
+
 dnl ------------------------------------------
 dnl ----  do some magic to gues the host opsys
 dnl ----  taken from libvorbis configure.in
--- a/swig/java/Makefile.am	Wed Sep 05 14:50:37 2007 +0000
+++ b/swig/java/Makefile.am	Wed Sep 05 17:44:23 2007 +0000
@@ -44,15 +44,15 @@
 	$(libxtract)
 
 .java.class: 
-	$(JAVAC) $(AM_JAVACFLAGS) $(JAVACFLAGS) $(swigjavafiles) -d . -classpath .
-	cp xtract/core/$@ .
+	$(JAVAC) $(AM_JAVACFLAGS) $(JAVACFLAGS) $(swigjavafiles)
 
 noinst_DATA = jar-stamp
 #
 jar-stamp: $(javaclasses) $(javafiles) 	
-	$(mkdir_p) xtract/core
-	$(mkdir_p) xtract/core/src
+	mkdir -p xtract/core
+	mkdir -p xtract/core/src
 	cp $(javafiles) xtract/core/src
+	cp $(javaclasses) xtract/core
 	touch jar-stamp
 #
 execjavawrapper_LTLIBRARIES = xtractjavac_wrap.la
--- a/swig/java/test.java	Wed Sep 05 14:50:37 2007 +0000
+++ b/swig/java/test.java	Wed Sep 05 17:44:23 2007 +0000
@@ -1,5 +1,5 @@
 
-import xtract.core.*;
+import jxtract.core.*;
 
 public class test {
     public static void main(String argv[]) {