Commit 28637d54 authored by Filippo Carone's avatar Filippo Carone

another attempt to make java bindings win32 friendly.

parent 09458513
...@@ -13,8 +13,10 @@ JINCLUDES = -I${JAVA_HOME}/include -I${JAVA_HOME}/include/win32 ...@@ -13,8 +13,10 @@ JINCLUDES = -I${JAVA_HOME}/include -I${JAVA_HOME}/include/win32
LIBJINCLUDES = -L${JAVA_HOME}/lib -ljawt LIBJINCLUDES = -L${JAVA_HOME}/lib -ljawt
JCC = javac JCC = javac
JCH = javah JCH = javah
JAVA_CC_FLAGS =
#CXX = g++ -Wall -mno-cygwin -g #CXX = g++ -Wall -mno-cygwin -g
#LDFLAGS = -mno-cygwin `vlc-config --libs external pic` -Wl,--kill-at #LDFLAGS = -mno-cygwin `vlc-config --libs external pic` -Wl,--kill-at
JAVACXXFLAGS = `top_builddir=../.. ../../vlc-config --cflags pic` -I../../ -I ../../include $(JINCLUDES)
JAVALDFLAGS = -mno-cygwin -L../../src -lvlc `top_builddir=../.. ../../vlc-config --libs builtin vlc pic` -Wl,--kill-at JAVALDFLAGS = -mno-cygwin -L../../src -lvlc `top_builddir=../.. ../../vlc-config --libs builtin vlc pic` -Wl,--kill-at
else else
JINCLUDES = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux JINCLUDES = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
...@@ -23,6 +25,7 @@ JCC = gcj -g ...@@ -23,6 +25,7 @@ JCC = gcj -g
JCH = gcjh -jni JCH = gcjh -jni
SWT_PATH = /usr/share/java SWT_PATH = /usr/share/java
# Compile flags # Compile flags
JAVA_CC_FLAGS = -C
JAVACXXFLAGS = `top_builddir=../.. ../../vlc-config --cflags pic` -I../../ -I ../../include $(JINCLUDES) JAVACXXFLAGS = `top_builddir=../.. ../../vlc-config --cflags pic` -I../../ -I ../../include $(JINCLUDES)
JAVALDFLAGS = -L../../src -lvlc `top_builddir=../.. ../../vlc-config --libs builtin vlc pic` JAVALDFLAGS = -L../../src -lvlc `top_builddir=../.. ../../vlc-config --libs builtin vlc pic`
endif endif
...@@ -32,7 +35,7 @@ all: libjvlc.so VlcClient VLCExample ...@@ -32,7 +35,7 @@ all: libjvlc.so VlcClient VLCExample
if HAVE_WIN32 if HAVE_WIN32
libjvlc.so: vlc-libvlc-jni.o vlc-graphics-jni.o libjvlc.so: vlc-libvlc-jni.o vlc-graphics-jni.o
$(CXX) -shared vlc-libvlc-jni.o vlc-graphics-jni.o $(LIBJINCLUDES) $(LDFLAGS) -o jvlc.dll $(CXX) -shared vlc-libvlc-jni.o vlc-graphics-jni.o $(LIBJINCLUDES) $(LDFLAGS) $(JAVALDFLAGS) -o jvlc.dll
else else
libjvlc.so: vlc-libvlc-jni.o vlc-graphics-jni.o libjvlc.so: vlc-libvlc-jni.o vlc-graphics-jni.o
$(CXX) -shared vlc-libvlc-jni.o vlc-graphics-jni.o $(LIBJINCLUDES) $(LDFLAGS) $(JAVALDFLAGS) -o libjvlc.so $(CXX) -shared vlc-libvlc-jni.o vlc-graphics-jni.o $(LIBJINCLUDES) $(LDFLAGS) $(JAVALDFLAGS) -o libjvlc.so
...@@ -45,13 +48,18 @@ vlc-libvlc-jni.o: VlcClient ...@@ -45,13 +48,18 @@ vlc-libvlc-jni.o: VlcClient
$(CXX) -c vlc-libvlc-jni.cc $(CXXFLAGS) $(JAVACXXFLAGS) $(CXX) -c vlc-libvlc-jni.cc $(CXXFLAGS) $(JAVACXXFLAGS)
VlcClient: $(OBJECTS) VlcClient: $(OBJECTS)
$(JCC) -C VlcClient.java $(JCC) $(JAVA_CC_FLAGS) VlcClient.java
VLCExample: $(OBJECTS) VLCExample: $(OBJECTS)
$(JCC) -C VLCExample.java $(JCC) $(JAVA_CC_FLAGS) VLCExample.java
if HAVE_WIN32
%.class: %.java
$(JCC) $(JAVA_CC_FLAGS) $?
$(JCH) org.videolan.jvlc.$(*F)
else
%.class: %.java %.class: %.java
$(JCC) -C $? $(JCC) $(JAVA_CC_FLAGS) $?
$(JCH) org/videolan/jvlc/$(*F) $(JCH) org/videolan/jvlc/$(*F)
clean: clean:
......
...@@ -26,7 +26,10 @@ ...@@ -26,7 +26,10 @@
#include <jawt.h> #include <jawt.h>
#include <jawt_md.h> #include <jawt_md.h>
#ifndef WIN32
#include <X11/Xlib.h> // for Xlibs graphics functions #include <X11/Xlib.h> // for Xlibs graphics functions
#endif
#include <stdio.h> // for printf #include <stdio.h> // for printf
/* JVLC internal imports, generated by gcjh */ /* JVLC internal imports, generated by gcjh */
...@@ -41,10 +44,16 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_JVLCCanvas_paint (JNIEnv *env, job ...@@ -41,10 +44,16 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_JVLCCanvas_paint (JNIEnv *env, job
JAWT awt; JAWT awt;
JAWT_DrawingSurface* ds; JAWT_DrawingSurface* ds;
JAWT_DrawingSurfaceInfo* dsi; JAWT_DrawingSurfaceInfo* dsi;
#ifdef WIN32
JAWT_Win32DrawingSurfaceInfo* dsi_win;
#else
JAWT_X11DrawingSurfaceInfo* dsi_x11; JAWT_X11DrawingSurfaceInfo* dsi_x11;
GC gc;
#endif
jint lock; jint lock;
GC gc;
vlc_value_t value; vlc_value_t value;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment