Skip to content

Commit

Permalink
Merge branch 'opensl'
Browse files Browse the repository at this point in the history
  • Loading branch information
nettoyeurny committed Dec 28, 2012
2 parents febda63 + 0a8bb21 commit 76bfebc
Show file tree
Hide file tree
Showing 30 changed files with 2,309 additions and 821 deletions.
2 changes: 1 addition & 1 deletion .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
<classpathentry kind="lib" path="libs/objenesis-1.2.jar"/>
<classpathentry kind="lib" path="libs/cglib-2.2.jar"/>
<classpathentry kind="lib" path="libs/asm-3.3.jar"/>
<classpathentry kind="output" path="java"/>
<classpathentry kind="output" path="java-build"/>
</classpath>
142 changes: 87 additions & 55 deletions Android.mk
Original file line number Diff line number Diff line change
@@ -1,137 +1,170 @@
LOCAL_PATH := $(call my-dir)

# PD-specific flags

PD_SRC_FILES := \
pure-data/src/d_arithmetic.c pure-data/src/d_array.c pure-data/src/d_ctl.c \
pure-data/src/d_dac.c pure-data/src/d_delay.c pure-data/src/d_fft.c \
pure-data/src/d_fft_mayer.c pure-data/src/d_fftroutine.c \
pure-data/src/d_filter.c pure-data/src/d_global.c pure-data/src/d_math.c \
pure-data/src/d_misc.c pure-data/src/d_osc.c pure-data/src/d_resample.c \
pure-data/src/d_soundfile.c pure-data/src/d_ugen.c \
pure-data/src/g_all_guis.c pure-data/src/g_array.c pure-data/src/g_bang.c \
pure-data/src/g_canvas.c pure-data/src/g_editor.c pure-data/src/g_graph.c \
pure-data/src/g_guiconnect.c pure-data/src/g_hdial.c \
pure-data/src/g_hslider.c pure-data/src/g_io.c pure-data/src/g_mycanvas.c \
pure-data/src/g_numbox.c pure-data/src/g_readwrite.c \
pure-data/src/g_rtext.c pure-data/src/g_scalar.c pure-data/src/g_template.c \
pure-data/src/g_text.c pure-data/src/g_toggle.c pure-data/src/g_traversal.c \
pure-data/src/g_vdial.c pure-data/src/g_vslider.c pure-data/src/g_vumeter.c \
pure-data/src/m_atom.c pure-data/src/m_binbuf.c pure-data/src/m_class.c \
pure-data/src/m_conf.c pure-data/src/m_glob.c pure-data/src/m_memory.c \
pure-data/src/m_obj.c pure-data/src/m_pd.c pure-data/src/m_sched.c \
pure-data/src/s_audio.c pure-data/src/s_audio_dummy.c \
pure-data/src/s_file.c pure-data/src/s_inter.c \
pure-data/src/s_loader.c pure-data/src/s_main.c pure-data/src/s_path.c \
pure-data/src/s_print.c pure-data/src/s_utf8.c pure-data/src/x_acoustics.c \
pure-data/src/x_arithmetic.c pure-data/src/x_connective.c \
pure-data/src/x_gui.c pure-data/src/x_list.c pure-data/src/x_midi.c \
pure-data/src/x_misc.c pure-data/src/x_net.c pure-data/src/x_qlist.c \
pure-data/src/x_time.c pure-data/src/x_interface.c \
libpd_wrapper/s_libpdmidi.c libpd_wrapper/x_libpdreceive.c \
libpd_wrapper/z_libpd.c libpd_wrapper/ringbuffer.c libpd_wrapper/z_queued.c
PD_C_INCLUDES := $(LOCAL_PATH)/pure-data/src $(LOCAL_PATH)/libpd_wrapper
PD_CFLAGS := -DPD -DHAVE_UNISTD_H -DHAVE_LIBDL -DUSEAPI_DUMMY
PD_JNI_CFLAGS := -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast
PD_LDLIBS := -ldl


# Build libpd

include $(CLEAR_VARS)

LOCAL_MODULE := pd
LOCAL_C_INCLUDES := $(PD_C_INCLUDES)
LOCAL_CFLAGS := $(PD_CFLAGS)
LOCAL_LDLIBS := $(PD_LDLIBS)
LOCAL_SRC_FILES := $(PD_SRC_FILES)
include $(BUILD_SHARED_LIBRARY)

# Build main library.

# Build plain JNI binary

include $(CLEAR_VARS)

LOCAL_MODULE := pdnative
LOCAL_C_INCLUDES := $(LOCAL_PATH)/pure-data/src $(LOCAL_PATH)/libpd_wrapper
LOCAL_CFLAGS := -DPD -DHAVE_UNISTD_H -DHAVE_LIBDL -DUSEAPI_DUMMY \
-Wno-int-to-pointer-cast -Wno-pointer-to-int-cast
LOCAL_LDLIBS := -ldl
LOCAL_SRC_FILES := \
pure-data/src/d_arithmetic.c pure-data/src/d_array.c pure-data/src/d_ctl.c \
pure-data/src/d_dac.c pure-data/src/d_delay.c pure-data/src/d_fft.c \
pure-data/src/d_fft_mayer.c pure-data/src/d_fftroutine.c \
pure-data/src/d_filter.c pure-data/src/d_global.c pure-data/src/d_math.c \
pure-data/src/d_misc.c pure-data/src/d_osc.c pure-data/src/d_resample.c \
pure-data/src/d_soundfile.c pure-data/src/d_ugen.c \
pure-data/src/g_all_guis.c pure-data/src/g_array.c pure-data/src/g_bang.c \
pure-data/src/g_canvas.c pure-data/src/g_editor.c pure-data/src/g_graph.c \
pure-data/src/g_guiconnect.c pure-data/src/g_hdial.c \
pure-data/src/g_hslider.c pure-data/src/g_io.c pure-data/src/g_mycanvas.c \
pure-data/src/g_numbox.c pure-data/src/g_readwrite.c \
pure-data/src/g_rtext.c pure-data/src/g_scalar.c pure-data/src/g_template.c \
pure-data/src/g_text.c pure-data/src/g_toggle.c pure-data/src/g_traversal.c \
pure-data/src/g_vdial.c pure-data/src/g_vslider.c pure-data/src/g_vumeter.c \
pure-data/src/m_atom.c pure-data/src/m_binbuf.c pure-data/src/m_class.c \
pure-data/src/m_conf.c pure-data/src/m_glob.c pure-data/src/m_memory.c \
pure-data/src/m_obj.c pure-data/src/m_pd.c pure-data/src/m_sched.c \
pure-data/src/s_audio.c pure-data/src/s_audio_dummy.c \
pure-data/src/s_file.c pure-data/src/s_inter.c \
pure-data/src/s_loader.c pure-data/src/s_main.c pure-data/src/s_path.c \
pure-data/src/s_print.c pure-data/src/s_utf8.c pure-data/src/x_acoustics.c \
pure-data/src/x_arithmetic.c pure-data/src/x_connective.c \
pure-data/src/x_gui.c pure-data/src/x_list.c pure-data/src/x_midi.c \
pure-data/src/x_misc.c pure-data/src/x_net.c pure-data/src/x_qlist.c \
pure-data/src/x_time.c pure-data/src/x_interface.c \
libpd_wrapper/s_libpdmidi.c libpd_wrapper/x_libpdreceive.c \
libpd_wrapper/z_libpd.c libpd_wrapper/z_jni.c
LOCAL_C_INCLUDES := $(PD_C_INCLUDES)
LOCAL_CFLAGS := $(PD_JNI_CFLAGS)
LOCAL_SRC_FILES := jni/z_jni_plain.c
LOCAL_SHARED_LIBRARIES := pd
include $(BUILD_SHARED_LIBRARY)


# Build libchoice.so.
# Build OpenSL JNI binary

include $(CLEAR_VARS)

LOCAL_MODULE := pdnativeopensl
LOCAL_C_INCLUDES := $(PD_C_INCLUDES) $(LOCAL_PATH)/jni
LOCAL_CFLAGS := $(PD_JNI_CFLAGS)
LOCAL_LDLIBS := -lOpenSLES
LOCAL_SRC_FILES := jni/opensl_io.c jni/z_jni_opensl.c
LOCAL_SHARED_LIBRARIES := pd
include $(BUILD_SHARED_LIBRARY)


# Build libchoice.so

include $(CLEAR_VARS)

LOCAL_MODULE := choice
LOCAL_C_INCLUDES := $(LOCAL_PATH)/pure-data/src
LOCAL_CFLAGS := -DPD
LOCAL_SRC_FILES := pure-data/extra/choice/choice.c
LOCAL_SHARED_LIBRARIES := pdnative
LOCAL_SHARED_LIBRARIES := pd

include $(BUILD_SHARED_LIBRARY)


# Build libbonk~.so
# Build libbonk_tilde.so

include $(CLEAR_VARS)

LOCAL_MODULE := bonk~
LOCAL_MODULE := bonk_tilde
LOCAL_C_INCLUDES := $(LOCAL_PATH)/pure-data/src
LOCAL_CFLAGS := -DPD
LOCAL_SRC_FILES := pure-data/extra/bonk~/bonk~.c
LOCAL_SHARED_LIBRARIES := pdnative
LOCAL_SHARED_LIBRARIES := pd

include $(BUILD_SHARED_LIBRARY)


# Build liblrshift~.so
# Build liblrshift_tilde.so

include $(CLEAR_VARS)

LOCAL_MODULE := lrshift~
LOCAL_MODULE := lrshift_tilde
LOCAL_C_INCLUDES := $(LOCAL_PATH)/pure-data/src
LOCAL_CFLAGS := -DPD
LOCAL_SRC_FILES := pure-data/extra/lrshift~/lrshift~.c
LOCAL_SHARED_LIBRARIES := pdnative
LOCAL_SHARED_LIBRARIES := pd

include $(BUILD_SHARED_LIBRARY)


#Build libfiddle~.so
# Build libfiddle_tilde.so

include $(CLEAR_VARS)

LOCAL_MODULE := fiddle~
LOCAL_MODULE := fiddle_tilde
LOCAL_C_INCLUDES := $(LOCAL_PATH)/pure-data/src
LOCAL_CFLAGS := -DPD
LOCAL_SRC_FILES := pure-data/extra/fiddle~/fiddle~.c
LOCAL_SHARED_LIBRARIES := pdnative
LOCAL_SHARED_LIBRARIES := pd

include $(BUILD_SHARED_LIBRARY)


#Build libsigmund~.so
# Build libsigmund_tilde.so

include $(CLEAR_VARS)

LOCAL_MODULE := sigmund~
LOCAL_MODULE := sigmund_tilde
LOCAL_C_INCLUDES := $(LOCAL_PATH)/pure-data/src
LOCAL_CFLAGS := -DPD
LOCAL_SRC_FILES := pure-data/extra/sigmund~/sigmund~.c
LOCAL_SHARED_LIBRARIES := pdnative
LOCAL_SHARED_LIBRARIES := pd

include $(BUILD_SHARED_LIBRARY)


#Build libpique.so
# Build libpique.so

include $(CLEAR_VARS)

LOCAL_MODULE := pique
LOCAL_C_INCLUDES := $(LOCAL_PATH)/pure-data/src
LOCAL_CFLAGS := -DPD
LOCAL_SRC_FILES := pure-data/extra/pique/pique.c
LOCAL_SHARED_LIBRARIES := pdnative
LOCAL_SHARED_LIBRARIES := pd

include $(BUILD_SHARED_LIBRARY)


#Build libloop~.so
# Build libloop_tilde.so

include $(CLEAR_VARS)

LOCAL_MODULE := loop~
LOCAL_MODULE := loop_tilde
LOCAL_C_INCLUDES := $(LOCAL_PATH)/pure-data/src
LOCAL_CFLAGS := -DPD
LOCAL_SRC_FILES := pure-data/extra/loop~/loop~.c
LOCAL_SHARED_LIBRARIES := pdnative
LOCAL_SHARED_LIBRARIES := pd

include $(BUILD_SHARED_LIBRARY)


# Build libexpr~.so
# Build libexpr.so

include $(CLEAR_VARS)

Expand All @@ -140,7 +173,6 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/pure-data/src
LOCAL_CFLAGS := -DPD
LOCAL_SRC_FILES := pure-data/extra/expr~/vexp.c \
pure-data/extra/expr~/vexp_fun.c pure-data/extra/expr~/vexp_if.c
LOCAL_SHARED_LIBRARIES := pdnative
LOCAL_SHARED_LIBRARIES := pd

include $(BUILD_SHARED_LIBRARY)

7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ PDJAVA_JAR_CLASSES = \
java/org/puredata/core/utils/PdDispatcher.java


JNI_FILE = libpd_wrapper/z_jni.c
JNIH_FILE = libpd_wrapper/z_jni.h
JNI_FILE = libpd_wrapper/ringbuffer.c libpd_wrapper/z_queued.c \
jni/z_jni_plain.c
JNIH_FILE = jni/z_jni.h
JAVA_BASE = java/org/puredata/core/PdBase.java
HOOK_SET = libpd_wrapper/z_csharp_helper.c
LIBPD = libs/libpd.$(SOLIB_EXT)
Expand All @@ -103,7 +104,7 @@ libpd: $(LIBPD)
$(LIBPD): ${PD_FILES:.c=.o}
$(CC) -o $(LIBPD) $^ $(LDFLAGS) -lm -lpthread

javalib: $(PDJAVA_JAR)
javalib: $(JNIH_FILE) $(PDJAVA_JAR)

$(JNIH_FILE): $(JAVA_BASE)
javac -classpath java $^
Expand Down
2 changes: 2 additions & 0 deletions java/org/puredata/core/NativeLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public class NativeLoader {

public static class NativeLibraryLoadError extends UnsatisfiedLinkError {

private static final long serialVersionUID = 1L;

public NativeLibraryLoadError(String message) {
super(message);
}
Expand Down
Loading

0 comments on commit 76bfebc

Please sign in to comment.