Make java bindings compile with libtool
authorFilippo Carone <littlejohn@videolan.org>
Thu, 16 Nov 2006 23:03:14 +0000 (23:03 +0000)
committerFilippo Carone <littlejohn@videolan.org>
Thu, 16 Nov 2006 23:03:14 +0000 (23:03 +0000)
Makefile.am
src/Makefile.am [new file with mode: 0644]

index b3f9f75..c52dcac 100644 (file)
@@ -2,9 +2,7 @@
 # VLC Java Bindings
 #######################################################################
 
-#SUBDIRS= src
-
-DIST_SUBDIRS = src
+SUBDIRS= . src
 
 EXTRA_DIST= \
            FAQ \
@@ -15,7 +13,6 @@ EXTRA_DIST= \
            VlcClient.java \
            VLCExample.java
 
-
 EXTRA_DIST+= \
        org/videolan/jvlc/AudioIntf.java \
        org/videolan/jvlc/Audio.java \
@@ -38,10 +35,6 @@ if BUILD_JAVA
 
 OBJECTS = org/videolan/jvlc/VLCException.class org/videolan/jvlc/Playlist.class org/videolan/jvlc/AudioIntf.class org/videolan/jvlc/Audio.class org/videolan/jvlc/InputIntf.class org/videolan/jvlc/Input.class org/videolan/jvlc/PlaylistIntf.class org/videolan/jvlc/VideoIntf.class org/videolan/jvlc/Video.class org/videolan/jvlc/JLibVLC.class org/videolan/jvlc/JVLC.class org/videolan/jvlc/JVLCCanvas.class org/videolan/jvlc/JVLCPanel.class org/videolan/jvlc/VLMIntf.class org/videolan/jvlc/VLM.class  org/videolan/jvlc/GenericVideoWidget.class
 
-OBJECTS_HEADER = src/../includes/VLCException.h src/../includes/Playlist.h src/../includes/AudioIntf.h src/../includes/Audio.h src/../includes/InputIntf.h src/../includes/Input.h src/../includes/PlaylistIntf.h src/../includes/VideoIntf.h src/../includes/Video.h src/../includes/JLibVLC.h src/../includes/JVLC.h src/../includes/JVLCCanvas.h src/../includes/JVLCPanel.h src/../includes/VLMIntf.h src/../includes/VLM.h  src/../includes/GenericVideoWidget.h
-
-COBJECTS = src/utils.o src/video-jni.o src/audio-jni.o src/input-jni.o src/playlist-jni.o src/vlm-jni.o src/core-jni.o src/graphics-jni.o
-
 PROCESSOR_FAMILY = `uname -m | sed -e 's/^i.86/i386/' | sed -e 's/^x86_64/amd64/'`
 
 if HAVE_WIN32
@@ -54,63 +47,10 @@ LIBJINCLUDES = -L$(JAVA_HOME)/jre/lib/$(PROCESSOR_FAMILY) -ljawt
 JCH = gcjh -jni
 endif
 
-
-if USE_LIBTOOL
-jvlcdir = $(libdir)
-jvlc_LTLIBRARIES = libjvlc.la
-libjvlc_la_SOURCES = \
-       src/audio-jni.cc \
-       src/core-jni.cc \
-       src/graphics-jni.cc \
-       src/input-jni.cc \
-       src/playlist-jni.cc \
-       src/utils.cc \
-       src/utils.h \
-       src/video-jni.cc \
-       src/vlm-jni.cc
-
-libjvlc_la_LIBADD = ../../src/libvlc-control.la $(LIBJINCLUDES)
-
-if HAVE_WIN32
-libjvlc_la_JAVACXXFLAGS = `top_builddir=../.. ../../vlc-config --cflags pic` -I../../ -I ../../include $(JINCLUDES)
-libjvlc_la_JAVALDFLAGS = -mno-cygwin -L../../src -L../../src/.libs -lvlc-control `top_builddir=../.. ../../vlc-config --libs builtin vlc pic external` -Wl,--kill-at
-else
-libjvlc_la_JAVACXXFLAGS = `top_builddir=../.. ../../vlc-config --cflags pic` -I../../ -I ../../include $(JINCLUDES)
-libjvlc_la_JAVALDFLAGS = -L../../src -L../../src/.libs  -lvlc-control `top_builddir=../.. ../../vlc-config --libs builtin vlc pic external`
-endif
-
-else
-
-if HAVE_WIN32
-JAVACXXFLAGS = `top_builddir=../.. ../../vlc-config --cflags pic` -I../../ -I ../../include $(JINCLUDES)
-JAVALDFLAGS = -mno-cygwin -L../../src -L../../src/.libs -lvlc-control `top_builddir=../.. ../../vlc-config --libs builtin vlc pic external` -Wl,--kill-at
-else
-JAVACXXFLAGS = `top_builddir=../.. ../../vlc-config --cflags pic` -I../../ -I ../../include $(JINCLUDES)
-JAVALDFLAGS = -L../../src -L../../src/.libs  -lvlc-control `top_builddir=../.. ../../vlc-config --libs builtin vlc pic external`
-endif
-
-endif
-
 export JINCLUDES
+export LIBJINCLUDES
 
 # Build targets
-all: VlcClient VLCExample
-
-if HAVE_WIN32
-libjvlc.so: $(OBJECTS)
-       $(MAKE) -C src
-       $(CXX) -shared $(COBJECTS) $(LIBJINCLUDES) $(LDFLAGS) $(JAVALDFLAGS) -o jvlc.dll
-else
-libjvlc.so: $(OBJECTS)         
-       $(MAKE) -C src
-       $(CXX) -shared $(COBJECTS) $(LIBJINCLUDES) $(LDFLAGS) $(JAVALDFLAGS) -o libjvlc.so
-endif
-
-VlcClient: $(OBJECTS)
-       $(JAVAC) VlcClient.java
-
-VLCExample: $(OBJECTS)
-       $(JAVAC) VLCExample.java
 
 if HAVE_WIN32
 %.class: %.java 
@@ -122,7 +62,13 @@ else
        $(JCH) $(@D)/$(*F) -o includes/$(*F).h
 endif
 
-$(OBJECTS_HEADER): $(OBJECTS)
+VlcClient: $(OBJECTS)
+       $(JAVAC) VlcClient.java
+
+VLCExample: $(OBJECTS)
+       $(JAVAC) VLCExample.java
+
+all-am: VlcClient VLCExample
 
 clean-local:
        rm -f *.class *~ org/videolan/jvlc/*.class org_videolan*.h includes/*.h src/*.o *.so *.o *.dll
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644 (file)
index 0000000..11cd261
--- /dev/null
@@ -0,0 +1,49 @@
+EXTRA_DIST= \
+       audio-jni.cc \
+       core-jni.cc \
+       graphics-jni.cc \
+       input-jni.cc \
+       playlist-jni.cc \
+       utils.cc \
+       utils.h \
+       video-jni.cc \
+       vlm-jni.cc
+
+if BUILD_JAVA
+
+if USE_LIBTOOL
+
+jvlcdir = $(libdir)
+jvlc_LTLIBRARIES = libjvlc.la
+libjvlc_la_SOURCES = \
+       audio-jni.cc \
+       core-jni.cc \
+       graphics-jni.cc \
+       input-jni.cc \
+       playlist-jni.cc \
+       utils.cc \
+       utils.h \
+       video-jni.cc \
+       vlm-jni.cc
+
+libjvlc_la_LIBADD = ../../../src/libvlc-control.la $(LIBJINCLUDES)
+
+else
+
+COBJECTS = utils.o video-jni.o audio-jni.o input-jni.o playlist-jni.o vlm-jni.o core-jni.o graphics-jni.o
+
+JAVACXXFLAGS = -I. -Isrc -I../../ -I ../../include -I../../../include  $(JINCLUDES) `top_builddir=../../.. ../../../vlc-config --cflags pic` -c
+
+.cc.o:
+       $(CXX) $? $(CXXFLAGS) $(JAVACXXFLAGS) -o $@
+
+all-am: $(COBJECTS)
+
+endif
+
+.PHONY: clean-local
+
+clean-local:
+       rm -f *.o *~
+
+endif