I thought there is only one. =) This one -
http://kcat.strangesoft.net/openal.htmlHere is Android.mk:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := openal
FILE_LIST := $(wildcard $(LOCAL_PATH)/OpenAL32/*.c)
FILE_LIST += $(wildcard $(LOCAL_PATH)/Alc/*.c)
#FILE_LIST += $(wildcard $(LOCAL_PATH)/Alc/backends/*.c)
FILE_LIST += $(wildcard $(LOCAL_PATH)/Alc/effects/*.c)
FILE_LIST += $(wildcard $(LOCAL_PATH)/Alc/midi/*.c)
exclude := %alsa.c %dsound.c %oss.c %portaudio.c %pulseaudio.c\
%solaris.c %winmm.c %mixer_neon.c %mixer_sse.c %coreaudio.c\
%mmdevapi.c %qsa.c %sndio.c %mixer_inc.c
FILE_LIST := $(filter-out $(exclude),$(FILE_LIST))
LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%) Alc/backends/base.c\
Alc/backends/opensl.c Alc/backends/loopback.c Alc/backends/null.c
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/OpenAL32/Include $(LOCAL_PATH)/Alc
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include/AL
LOCAL_CFLAGS := -DAL_BUILD_LIBRARY -DAL_ALEXT_PROTOTYPES -DIN_IDE_PARSER -DNO_LOGGING -std=c99
LOCAL_LDLIBS := -lOpenSLES -llog -s
include $(BUILD_SHARED_LIBRARY)
About defines:
-std=c99 - solved the problem with multiple definitions.
IN_IDE_PARSER - fixes bug with
restrict macro, which is defined only when defined IN_IDE_PARSER
NO_LOGGING - my own define to disable ERR, WARN etc macros. I changed alMain.h:870 a little:
(i'm not checked, may be with forced C99 there are no need to disable log macros)
#ifdef NO_LOGGING
#define TRACEREF(...)
#define TRACE(...)
#define WARN(...)
#define ERR(...)
#else
#define TRACEREF(...) do { \
if(LogLevel >= LogRef) \
AL_PRINT("(--)", __VA_ARGS__); \
} while(0)
#define TRACE(...) do { \
if(LogLevel >= LogTrace) \
AL_PRINT("(II)", __VA_ARGS__); \
} while(0)
#define WARN(...) do { \
if(LogLevel >= LogWarning) \
AL_PRINT("(WW)", __VA_ARGS__); \
} while(0)
#define ERR(...) do { \
if(LogLevel >= LogError) \
AL_PRINT("(EE)", __VA_ARGS__); \
} while(0)
#end
#endif
And you'll need to create own
config.h from
config.h.in