Skip to content

Commit

Permalink
ogg support for Android
Browse files Browse the repository at this point in the history
  • Loading branch information
badaix committed Jul 11, 2016
1 parent 0f2c7e2 commit f316a9f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
14 changes: 7 additions & 7 deletions client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,30 @@ endif


CXXFLAGS += $(ADD_CFLAGS) -std=c++0x -Wall -Wno-unused-function -O3 -pthread -DASIO_STANDALONE -DVERSION=\"$(VERSION)\" -I. -I.. -I../externals/asio/asio/include -I../externals/popl/include
OBJ = snapClient.o stream.o clientConnection.o timeProvider.o player/player.o decoder/pcmDecoder.o decoder/flacDecoder.o controller.o ../message/pcmChunk.o ../common/log.o ../common/sampleFormat.o
OBJ = snapClient.o stream.o clientConnection.o timeProvider.o player/player.o decoder/pcmDecoder.o decoder/oggDecoder.o decoder/flacDecoder.o controller.o ../message/pcmChunk.o ../common/log.o ../common/sampleFormat.o

ifeq ($(TARGET), ANDROID)

CXX = $(NDK_DIR)/bin/arm-linux-androideabi-g++
STRIP = $(NDK_DIR)/bin/arm-linux-androideabi-strip
CXXFLAGS += -DANDROID -DNO_CPP11_STRING -fPIC -DHAS_OPENSL -I$(NDK_DIR)/include
LDFLAGS = -L$(NDK_DIR)/lib -pie -lFLAC -lOpenSLES
OBJ += player/openslPlayer.o
CXXFLAGS += -DANDROID -DNO_CPP11_STRING -fPIC -DHAS_TREMOR -DHAS_OPENSL -I$(NDK_DIR)/include
LDFLAGS = -L$(NDK_DIR)/lib -pie -lvorbisidec -logg -lFLAC -lOpenSLES
OBJ += player/openslPlayer.o

else ifeq ($(TARGET), OPENWRT)

STRIP = echo
CXXFLAGS += -DIS_BIG_ENDIAN -DNO_CPP11_STRING -DHAS_TREMOR -DHAS_ALSA -DHAS_AVAHI -DHAS_DAEMON
LDFLAGS = -lasound -logg -lvorbisidec -lFLAC -lavahi-client -lavahi-common -latomic
OBJ += player/alsaPlayer.o decoder/oggDecoder.o browseAvahi.o
LDFLAGS = -lasound -lvorbisidec -logg -lFLAC -lavahi-client -lavahi-common -latomic
OBJ += player/alsaPlayer.o browseAvahi.o

else

CXX = /usr/bin/g++
STRIP = strip
CXXFLAGS += -DHAS_OGG -DHAS_ALSA -DHAS_AVAHI -DHAS_DAEMON
LDFLAGS = -lrt -lasound -logg -lvorbis -lFLAC -lavahi-client -lavahi-common -static-libgcc -static-libstdc++
OBJ += player/alsaPlayer.o decoder/oggDecoder.o browseAvahi.o
OBJ += player/alsaPlayer.o browseAvahi.o

endif

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
export NDK_DIR="/home/johannes/Develop/android-toolchain-arm-14"
export CC=$NDK_DIR/bin/arm-linux-androideabi-gcc
export CXX=$NDK_DIR/bin/arm-linux-androideabi-g++
export CPPFLAGS="-U_ARM_ASSEM_ -I$NDK_DIR/include"

cd flac
./autogen.sh
./configure --host=arm --disable-ogg --prefix=$NDK_DIR
make
make install
make clean

cd ../ogg
./autogen.sh
./configure --host=arm --prefix=$NDK_DIR
make
make install
make clean

cd ../tremor
./autogen.sh
./configure --host=arm --prefix=$NDK_DIR --with-ogg=$NDK_DIR
make
make install
make clean

0 comments on commit f316a9f

Please sign in to comment.