Android.mk
author Sam Lantinga
Wed, 18 Oct 2017 00:29:15 -0700
changeset 790 23626ec410c8
parent 777 92882ef2ab81
child 791 3b05140ef301
permissions -rw-r--r--
mpg123 replaces smpeg as the default MP3 decoder for SDL_mixer
It's more robust, better maintained, more optimized, and uses the same license as SMPEG.
slouken@491
     1
LOCAL_PATH := $(call my-dir)
slouken@491
     2
slouken@491
     3
include $(CLEAR_VARS)
slouken@491
     4
slouken@581
     5
LOCAL_MODULE := SDL2_mixer
slouken@491
     6
slouken@754
     7
# Enable this if you want to support loading FLAC music via libFLAC
slouken@754
     8
# The library path should be a relative path to this directory.
slouken@754
     9
#
slouken@754
    10
# You need to symlink the FLAC_LIBRARY_PATH to your jni directory
slouken@754
    11
# so the shared library is built.
slouken@754
    12
SUPPORT_FLAC ?= true
slouken@754
    13
FLAC_LIBRARY_PATH := external/flac-1.3.2
slouken@754
    14
slouken@639
    15
# Enable this if you want to support loading MOD music via modplug
slouken@639
    16
# The library path should be a relative path to this directory.
slouken@672
    17
SUPPORT_MOD_MODPLUG ?= true
slouken@754
    18
MODPLUG_LIBRARY_PATH := external/libmodplug-0.8.9.0
slouken@626
    19
slouken@790
    20
# Enable this if you want to support loading MP3 music via mpg123
slouken@626
    21
# The library path should be a relative path to this directory.
slouken@754
    22
#
slouken@790
    23
# You need to symlink the MPG123_LIBRARY_PATH to your jni directory
slouken@754
    24
# so the shared library is built.
slouken@790
    25
SUPPORT_MP3_MPG123 ?= true
slouken@790
    26
MPG123_LIBRARY_PATH := external/mpg123-1.25.6
slouken@493
    27
slouken@626
    28
# Enable this if you want to support loading OGG Vorbis music via Tremor
slouken@626
    29
# The library path should be a relative path to this directory.
slouken@672
    30
SUPPORT_OGG ?= true
slouken@754
    31
OGG_LIBRARY_PATH := external/libogg-1.3.2
slouken@626
    32
VORBIS_LIBRARY_PATH := external/libvorbisidec-1.2.1
slouken@626
    33
slouken@626
    34
slouken@689
    35
# Enable this if you want to support TiMidity
slouken@689
    36
SUPPORT_TIMIDITY ?= true
slouken@689
    37
slouken@689
    38
LOCAL_C_INCLUDES := $(LOCAL_PATH) 
slouken@777
    39
LOCAL_CFLAGS := -DMUSIC_WAV
slouken@491
    40
slouken@685
    41
LOCAL_SRC_FILES := $(notdir $(filter-out %/playmus.c %/playwave.c, $(wildcard $(LOCAL_PATH)/*.c))) \
slouken@689
    42
slouken@491
    43
slouken@626
    44
LOCAL_LDLIBS :=
slouken@626
    45
LOCAL_STATIC_LIBRARIES :=
slouken@626
    46
LOCAL_SHARED_LIBRARIES := SDL2
slouken@626
    47
slouken@689
    48
ifeq ($(SUPPORT_TIMIDITY),true)
slouken@689
    49
	LOCAL_C_INCLUDES += $(LOCAL_PATH)/timidity
slouken@777
    50
	LOCAL_CFLAGS += -DMUSIC_MID -DMUSIC_MID_TIMIDITY
slouken@689
    51
	LOCAL_SRC_FILES += $(subst $(LOCAL_PATH)/,,$(wildcard $(LOCAL_PATH)/timidity/*.c))
slouken@689
    52
endif
slouken@689
    53
slouken@754
    54
ifeq ($(SUPPORT_FLAC),true)
slouken@754
    55
	LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(FLAC_LIBRARY_PATH)/include
slouken@777
    56
	LOCAL_CFLAGS += -DMUSIC_FLAC
slouken@754
    57
    LOCAL_SHARED_LIBRARIES += libFLAC
slouken@754
    58
endif
slouken@754
    59
slouken@639
    60
ifeq ($(SUPPORT_MOD_MODPLUG),true)
slouken@639
    61
    LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(MODPLUG_LIBRARY_PATH)/src $(LOCAL_PATH)/$(MODPLUG_LIBRARY_PATH)/src/libmodplug
slouken@777
    62
    LOCAL_CFLAGS += -DMUSIC_MOD_MODPLUG -DMODPLUG_HEADER="<modplug.h>" -DHAVE_SETENV -DHAVE_SINF
slouken@639
    63
    LOCAL_SRC_FILES += \
slouken@639
    64
        $(MODPLUG_LIBRARY_PATH)/src/fastmix.cpp \
slouken@639
    65
        $(MODPLUG_LIBRARY_PATH)/src/load_669.cpp \
slouken@639
    66
        $(MODPLUG_LIBRARY_PATH)/src/load_abc.cpp \
slouken@639
    67
        $(MODPLUG_LIBRARY_PATH)/src/load_amf.cpp \
slouken@639
    68
        $(MODPLUG_LIBRARY_PATH)/src/load_ams.cpp \
slouken@639
    69
        $(MODPLUG_LIBRARY_PATH)/src/load_dbm.cpp \
slouken@639
    70
        $(MODPLUG_LIBRARY_PATH)/src/load_dmf.cpp \
slouken@639
    71
        $(MODPLUG_LIBRARY_PATH)/src/load_dsm.cpp \
slouken@639
    72
        $(MODPLUG_LIBRARY_PATH)/src/load_far.cpp \
slouken@639
    73
        $(MODPLUG_LIBRARY_PATH)/src/load_it.cpp \
slouken@639
    74
        $(MODPLUG_LIBRARY_PATH)/src/load_j2b.cpp \
slouken@639
    75
        $(MODPLUG_LIBRARY_PATH)/src/load_mdl.cpp \
slouken@639
    76
        $(MODPLUG_LIBRARY_PATH)/src/load_med.cpp \
slouken@639
    77
        $(MODPLUG_LIBRARY_PATH)/src/load_mid.cpp \
slouken@639
    78
        $(MODPLUG_LIBRARY_PATH)/src/load_mod.cpp \
slouken@639
    79
        $(MODPLUG_LIBRARY_PATH)/src/load_mt2.cpp \
slouken@639
    80
        $(MODPLUG_LIBRARY_PATH)/src/load_mtm.cpp \
slouken@639
    81
        $(MODPLUG_LIBRARY_PATH)/src/load_okt.cpp \
slouken@639
    82
        $(MODPLUG_LIBRARY_PATH)/src/load_pat.cpp \
slouken@639
    83
        $(MODPLUG_LIBRARY_PATH)/src/load_psm.cpp \
slouken@639
    84
        $(MODPLUG_LIBRARY_PATH)/src/load_ptm.cpp \
slouken@639
    85
        $(MODPLUG_LIBRARY_PATH)/src/load_s3m.cpp \
slouken@639
    86
        $(MODPLUG_LIBRARY_PATH)/src/load_stm.cpp \
slouken@639
    87
        $(MODPLUG_LIBRARY_PATH)/src/load_ult.cpp \
slouken@639
    88
        $(MODPLUG_LIBRARY_PATH)/src/load_umx.cpp \
slouken@639
    89
        $(MODPLUG_LIBRARY_PATH)/src/load_wav.cpp \
slouken@639
    90
        $(MODPLUG_LIBRARY_PATH)/src/load_xm.cpp \
slouken@639
    91
        $(MODPLUG_LIBRARY_PATH)/src/mmcmp.cpp \
slouken@639
    92
        $(MODPLUG_LIBRARY_PATH)/src/modplug.cpp \
slouken@639
    93
        $(MODPLUG_LIBRARY_PATH)/src/snd_dsp.cpp \
slouken@639
    94
        $(MODPLUG_LIBRARY_PATH)/src/snd_flt.cpp \
slouken@639
    95
        $(MODPLUG_LIBRARY_PATH)/src/snd_fx.cpp \
slouken@639
    96
        $(MODPLUG_LIBRARY_PATH)/src/sndfile.cpp \
slouken@639
    97
        $(MODPLUG_LIBRARY_PATH)/src/sndmix.cpp
slouken@639
    98
endif
slouken@639
    99
slouken@790
   100
ifeq ($(SUPPORT_MP3_MPG123),true)
slouken@790
   101
    LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(MPG123_LIBRARY_PATH)
slouken@790
   102
    LOCAL_CFLAGS += -DMUSIC_MP3_MPG123
slouken@626
   103
    LOCAL_SHARED_LIBRARIES += smpeg2
slouken@626
   104
endif
slouken@626
   105
slouken@626
   106
ifeq ($(SUPPORT_OGG),true)
slouken@754
   107
    LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(OGG_LIBRARY_PATH)/android \
slouken@754
   108
                        $(LOCAL_PATH)/$(OGG_LIBRARY_PATH)/include \
slouken@754
   109
                        $(LOCAL_PATH)/$(VORBIS_LIBRARY_PATH)
slouken@777
   110
    LOCAL_CFLAGS += -DMUSIC_OGG -DOGG_USE_TREMOR -DOGG_HEADER="<ivorbisfile.h>"
slouken@671
   111
    ifeq ($(TARGET_ARCH_ABI),armeabi)
slouken@671
   112
	LOCAL_CFLAGS += -D_ARM_ASSEM_
slouken@671
   113
    endif
slouken@671
   114
    ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
slouken@671
   115
	LOCAL_CFLAGS += -D_ARM_ASSEM_
slouken@671
   116
    endif
slouken@626
   117
    LOCAL_SRC_FILES += \
slouken@626
   118
        $(VORBIS_LIBRARY_PATH)/mdct.c \
slouken@626
   119
        $(VORBIS_LIBRARY_PATH)/block.c \
slouken@626
   120
        $(VORBIS_LIBRARY_PATH)/window.c \
slouken@626
   121
        $(VORBIS_LIBRARY_PATH)/synthesis.c \
slouken@626
   122
        $(VORBIS_LIBRARY_PATH)/info.c \
slouken@626
   123
        $(VORBIS_LIBRARY_PATH)/floor1.c \
slouken@626
   124
        $(VORBIS_LIBRARY_PATH)/floor0.c \
slouken@626
   125
        $(VORBIS_LIBRARY_PATH)/vorbisfile.c \
slouken@626
   126
        $(VORBIS_LIBRARY_PATH)/res012.c \
slouken@626
   127
        $(VORBIS_LIBRARY_PATH)/mapping0.c \
slouken@626
   128
        $(VORBIS_LIBRARY_PATH)/registry.c \
slouken@626
   129
        $(VORBIS_LIBRARY_PATH)/codebook.c \
slouken@626
   130
        $(VORBIS_LIBRARY_PATH)/sharedbook.c \
slouken@626
   131
        $(OGG_LIBRARY_PATH)/src/framing.c \
slouken@626
   132
        $(OGG_LIBRARY_PATH)/src/bitwise.c
slouken@626
   133
endif
slouken@491
   134
slouken@643
   135
LOCAL_EXPORT_C_INCLUDES += $(LOCAL_C_INCLUDES)
slouken@643
   136
slouken@673
   137
LOCAL_ARM_MODE := arm
slouken@673
   138
slouken@491
   139
include $(BUILD_SHARED_LIBRARY)