diff configure.in @ 88:525bfdf936c6

Added java bindings. Everything seems to work OK, except test.java won't compile. Some kind of path error, but I can't work out how to fix it.
author Jamie Bullock <jamie@postlude.co.uk>
date Wed, 05 Sep 2007 14:32:17 +0000
parents 0df00d5c9269
children 8553b27a5062
line wrap: on
line diff
--- a/configure.in	Tue Sep 04 19:07:55 2007 +0000
+++ b/configure.in	Wed Sep 05 14:32:17 2007 +0000
@@ -85,6 +85,19 @@
     echo
     ])
 
+dnl If --enable-swig, make with java bindings
+AC_ARG_WITH(java,
+    [ --with-java If --enable-swig - make with java bindings (default=no) ],
+    [with_java=true])
+
+AM_CONDITIONAL(BUILD_JAVA, test "x${with_java}" = 'xtrue')
+
+dnl If --enable-swig, make with java bindings
+AC_ARG_WITH(python,
+    [ --with-python If --enable-swig - make with python bindings (default=no) ],    [with_python=true])
+
+AM_CONDITIONAL(BUILD_PYTHON, test "x${with_python}" = 'xtrue')
+
 dnl Are we building with fftw?
 if [[ "$fft" = "true" ]] ; then
     LDFLAGS="$LDFLAGS -lfftw3f"
@@ -148,11 +161,27 @@
 dnl SWIG stuff
 if [[ "$swig" = "true" ]] ; then
     AC_PROG_SWIG(1.3.21)
+    AC_DEFINE([BUILD_SWIG], [1], [Build the swig bindings])
+fi
+
+if [[ "$with_java" = "true" ]] ; then
+    AC_PROG_JAVAC
+    AC_JNI_INCLUDE_DIR
+
+    for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS
+    do
+	CFLAGS="$CFLAGS -I$JNI_INCLUDE_DIR"
+    done
+   dnl AC_PROG_JAVAH
+   dnl AC_PATH_PROG(JAVAH,javah)
+fi
+
+if [[ "$with_python" = "true" ]] ; then
     AM_PATH_PYTHON
     SWIG_PYTHON
-    AC_DEFINE([BUILD_SWIG], [1], [Build the swig bindings])
 fi
 
+
 AM_CONDITIONAL(BUILD_SWIG, test "x${swig}" = 'xtrue')
 
 dnl ------------------------------------------
@@ -232,7 +261,8 @@
 AC_CONFIG_FILES([doc/documentation.doxygen
 				libxtract.pc])
 
-AC_OUTPUT(Makefile src/Makefile xtract/Makefile doc/Makefile examples/Makefile examples/puredata/Makefile examples/simpletest/Makefile swig/Makefile)
+dnl There must be a better way to do this...
+AC_OUTPUT(Makefile src/Makefile xtract/Makefile doc/Makefile examples/Makefile examples/puredata/Makefile examples/simpletest/Makefile swig/Makefile swig/python/Makefile swig/java/Makefile)
 
 echo
 echo "**************************************************************"
@@ -261,9 +291,14 @@
   echo "PD external:             no"
 fi
 if test "$swig" == "true"; then
-  echo "SWIG Python bindings:                      yes"
+  echo "SWIG bindings:                      yes"
 else
-  echo "SWIG Python bindings:                      no"
+  echo "SWIG bindings:                      no"
+fi
+if test "$with_java" == "true"; then
+    echo "with JAVA module:		    yes"
+else
+    echo "with JAVA module:		    no"
 fi
 echo
 echo "**************************************************************"