doubango编译

     doubango源码下载下来之后,对之进行编译,折腾了一天,才搞出来。本来对NDK也不是很熟,shell命令也懂的不多。结果就是在反复试了。编译静态库是在/doubango/android-projects/下面的buildAll.sh执行就Ok的。buildAll.sh只是指明了对哪些库进行打包,doubango的这些库是互相依赖的,详情可以看doubango官网。在google code IMSDroid项目中,维基百科里有一个关于imsdroid编译的,说的还算清除,但是我的就是编译不成功。一方面官方的root.mk是基于windows操作系统的ndk4进行编译的,而我用的是macos。也找不来ndk4的了,只好用了ndk8.下面是我改过的root.mk。。

######
##	Root configuration file shared by all android projects.
######

export ANDROID_NDK_ROOT=/Users/johanabusaken/software/android-ndk-r8
export ANDROID_SDK_ROOT=/Users/johanabusaken/software/android-sdk-macosx
export ANDROID_PLATFORM=android-5
export ANDROID_HOST=darwin-x86
export ANDROID_GCC_VER=4.4.3


# Output directory
export OUTPUT_DIR=$(shell pwd)/output
$(shell mkdir -p $(OUTPUT_DIR))

# Path where to copy executables -on the device or emulator-
export EXEC_DIR=/data/tmp
# Path where to copy libraries (*.so) -on the device or emulator-
export LIB_DIR=/system/lib

# Test the NDK directory structure
export ANDROID_NDK_BASE=$(shell if [ -r $(ANDROID_NDK_ROOT)/build/platforms ] ; then \
		echo $(ANDROID_NDK_ROOT)/build/platforms ; \
	elif [ -r $(ANDROID_NDK_ROOT)/platforms ] ; then \
		echo $(ANDROID_NDK_ROOT)/platforms ; \
	else \
		echo "Err_Unable_to_recognize_the_NDK_structure_for_ANDROID_NDK_BASE" ; \
	fi)

export ANDROID_NDK_TOOL_BASE=$(shell if [ -r $(ANDROID_NDK_ROOT)/build/prebuilt/$(ANDROID_HOST)/arm-linux-androideabi-$(ANDROID_GCC_VER) ] ; then \
		echo $(ANDROID_NDK_ROOT)/build/prebuilt/$(ANDROID_HOST)/arm-linux-androideabi-$(ANDROID_GCC_VER) ; \
	elif [ -r $(ANDROID_NDK_ROOT)/toolchains/arm-linux-androideabi-$(ANDROID_GCC_VER)/prebuilt/$(ANDROID_HOST) ] ; then \
		echo $(ANDROID_NDK_ROOT)/toolchains/arm-linux-androideabi-$(ANDROID_GCC_VER)/prebuilt/$(ANDROID_HOST) ; \
	else \
		echo "Err_Unable_to_recognize_the_NDK_structure_for_ANDROID_NDK_TOOL_BASE" ; \
	fi)

##################################################################################

export AR=$(ANDROID_NDK_TOOL_BASE)/bin/arm-linux-androideabi-ar
export CC=$(ANDROID_NDK_TOOL_BASE)/bin/arm-linux-androideabi-gcc-4.4.3
export CPP=$(ANDROID_NDK_TOOL_BASE)/bin/arm-linux-androideabi-g++


ifeq ($(LICENSE),)
	export LICENSE=gpl
endif


export CFLAGS_COMMON=$(CFLAGS) $(DEBUG_FLAGS) -I$(ANDROID_NDK_BASE)/$(ANDROID_PLATFORM)/arch-arm/usr/include \
-msoft-float \
-fpic \
-mthumb-interwork \
-ffunction-sections \
-funwind-tables \
-fstack-protector \
-D__ARM_ARCH_5__ \
-D__ARM_ARCH_5T__ \
-D__ARM_ARCH_5E__ \
-D__ARM_ARCH_5TE__ \
-MMD \
-MP \
-fno-short-enums \
-DANDROID=1

ifeq ($(NEON), yes)
export MARCH=armv7-a
export CFLAGS_COMMON+=-march=$(MARCH) -mtune=cortex-a8 -mfpu=neon -DHAVE_NEON=1 \
-D__ARM_ARCH_7__ -D__ARM_ARCH_7A__ -Wno-psabi -mfloat-abi=softfp
else
export MARCH=armv5te
export CFLAGS_COMMON+=-march=$(MARCH) -mtune=xscale
endif

export CFLAGS_LIB= $(CFLAGS_COMMON) \
-Os \
-fomit-frame-pointer \
-fno-strict-aliasing \
-finline-limit=64 

export LDFLAGS_COMMON=$(LDFLAGS) -Wl,-rpath=/system/lib,-rpath-link=$(ANDROID_NDK_BASE)/$(ANDROID_PLATFORM)/arch-arm/usr/lib,-rpath-link=$(OUTPUT_DIR),-dynamic-linker=/system/bin/linker,-T,$(ANDROID_NDK_TOOL_BASE)/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.xsc -L$(ANDROID_NDK_TOOL_BASE)/lib/gcc/arm-linux-androideabi/4.4.3 \
	-nostdlib -L$(ANDROID_NDK_TOOL_BASE)/lib/gcc \
	-L$(ANDROID_NDK_TOOL_BASE)/lib/gcc/arm-linux-androideabi/4.4.3/ \
  -L$(ANDROID_NDK_BASE)/$(ANDROID_PLATFORM)/arch-arm/usr/lib
export LDFLAGS_COMMON+=-lc -ldl -L$(OUTPUT_DIR)

ifeq ($(BT), static)
	export EXT=a
	export LDFLAGS_LIB=
	
	export CFLAGS_LIB+=-static
else
	export EXT=so
	
	export LDFLAGS_LIB=$(LDFLAGS_COMMON)
	export LDFLAGS_LIB+=-Wl,--no-whole-archive
	export LDFLAGS_LIB+=-Wl,-soname,lib$(PROJECT).$(EXT),-Bsymbolic,-shared,--whole-archive
endif

 

再说下,doubango关于视频音频编码的控制主要在doubango/bindings/java/android/下面的gpl.sh或者lgps.sh或minimal.sh控制的,可以根据自己需要的编码进行修改。

你可能感兴趣的:(Go)