Changeset 4197


Ignore:
Timestamp:
Dec 23, 2009, 12:34:49 PM (7 years ago)
Author:
sam
Message:

Java bindings, courtesy of Adrien Grand <jpountz@dinauz.org>.

Location:
libcaca/trunk
Files:
31 added
3 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/AUTHORS

    r3489 r4197  
    2727 - PHP bindings
    2828
     29Adrien Grand <jpountz@dinauz.org>
     30 - Java bindings
     31
    2932*/
  • libcaca/trunk/Makefile.am

    r4044 r4197  
    11# $Id$
    22
    3 SUBDIRS = kernel caca src examples tools caca-sharp cxx python ruby doc test
     3SUBDIRS = kernel caca src examples tools \
     4          cxx caca-sharp python ruby java \
     5          doc test
    46DIST_SUBDIRS = $(SUBDIRS) win32
    57
  • libcaca/trunk/configure.ac

    r4154 r4197  
    7979AC_ARG_ENABLE(csharp,
    8080  [  --enable-csharp         C# bindings (autodetected)])
     81AC_ARG_ENABLE(java,
     82  [  --enable-java           Java bindings (autodetected)])
    8183AC_ARG_ENABLE(cxx,
    8284  [  --enable-cxx            C++ bindings (autodetected)])
     
    409411AM_CONDITIONAL(USE_CSHARP, test "${ac_cv_my_have_csharp}" = "yes")
    410412
     413# Build the Java bindings?
     414ac_cv_my_have_java="no"
     415if test "${enable_java}" != "no"; then
     416  AC_PATH_PROG(JAVAC, javac, no)
     417  AC_PATH_PROG(JAVAH, javah, no)
     418  AC_PATH_PROG(JAR, jar, no)
     419  if test "${JAVAC}" != "no" -a "${JAVAH}" != "no" -a "${JAR}" != "no"; then
     420    if test "$JAVA_HOME" = ""; then
     421      # Try to resolve JAVA_HOME
     422      JAVAC_EXE="$JAVAC"
     423      # Follow symlinks
     424      while test -h "$JAVAC_EXE"; do
     425        ls=`ls -ld "$JAVAC_EXE"`
     426        link=`expr "$ls" : '.*-> \(.*\)$'`
     427        if expr "$link" : '/.*' > /dev/null; then
     428          JAVAC_EXE="$link"
     429        else
     430          JAVAC_EXE="`dirname "$JAVAC_EXE"`/$link"
     431        fi
     432      done
     433      JAVA_HOME="`dirname $JAVAC_EXE`/.."
     434    fi
     435    # Include path to jni.h
     436    JAVA_CFLAGS="${JAVA_CFLAGS} -I$JAVA_HOME/include"
     437    # Add the OS specific include path
     438    for dir in $JAVA_HOME/include/*; do
     439      if test -f "$dir/jni_md.h"; then
     440        JAVA_CFLAGS="${JAVA_CFLAGS} -I$dir"
     441      fi
     442    done
     443    AC_SUBST(JAVA_CFLAGS)
     444    AC_SUBST(JAVA_LIBS)
     445    AC_LANG_PUSH(C)
     446    CPPFLAGS="${CPPFLAGS} ${JAVA_CFLAGS}"
     447    AC_CHECK_HEADERS([jni.h],
     448     [ac_cv_my_have_java="yes"
     449      CACA_BINDINGS="${CACA_BINDINGS} Java"])
     450    AC_LANG_POP(C)
     451  fi
     452fi
     453AM_CONDITIONAL(USE_JAVA, test "${ac_cv_my_have_java}" = "yes")
     454
    411455# Build the Ruby bindings?
    412456ac_cv_my_have_ruby="no"
     
    507551  test/Makefile
    508552  tools/Makefile
     553  java/Makefile
    509554  caca-sharp/Makefile
    510555  cxx/Makefile
Note: See TracChangeset for help on using the changeset viewer.