BUILD_PATH=/home/zangcf/segmenter/build
PKG_CONFIG_PATH=/home/zangcf/segmenter/build/lib/pkgconfig
CC_PATH=/opt/android-toolchain/android-14/bin/arm-linux-androideabi-gcc
CPP_PATH=/opt/android-toolchain/android-14/bin/arm-linux-androideabi-cpp
./configure \
--prefix=$BUILD_PATH \
--build=arm \
CC=$CC_PATH \
CPP=$CPP_PATH \
--host=arm-linux \
FFMPEG_CFLAGS="-I/home/zangcf/segmenter/ffmpeg" \
FFMPEG_LIBS="-L/home/zangcf/segmenter/ffmpeg/libavcodec -L/home/zangcf/segmenter/ffmpeg/libavformat -L/home/zangcf/segmenter/ffmpeg/libavutil -pthread -lavformat -lavcodec -lavutil -lm -lz" \
LDFLAGS="-L/home/zangcf/segmenter/build/lib -L/opt/android-ndk-r9b/platforms/android-8/arch-arm/usr/lib/ -L/opt/android-ndk-r9b/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.8,-lpthread" \
CFLAGS="-lc -lm -ldl -lgcc -lz"
-------------------------------------------------------------------------------
--------------一个my_configure_m3u8.sh end here-------------------------------
然后执行这个脚本,应该没有错误,输出的最后信息是
checking for FFMPEG... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating tests/Makefile
config.status: executing depfiles commands
----------------------------------------------
如果不是这个信息,请检查脚本的目录对应是不是正确了。
然后执行make,会输出如下信息::
------------------------------------------------------------------------------------------------
m3u8_segmenter-m3u8-segmenter.o:m3u8-segmenter.c:function write_index_file: error: undefined reference to 'rpl_malloc'
m3u8_segmenter-m3u8-segmenter.o:m3u8-segmenter.c:function main: error: undefined reference to 'rpl_malloc'
m3u8_segmenter-m3u8-segmenter.o:m3u8-segmenter.c:function main: error: undefined reference to 'rpl_malloc'
m3u8_segmenter-m3u8-segmenter.o:m3u8-segmenter.c:function main: error: undefined reference to 'rpl_malloc'
collect2: error: ld returned 1 exit status
make[1]: *** [m3u8-segmenter] 错误 1
make[1]:正在离开目录 `/home/zangcf/segmenter/m3u8-segmenter'
make: *** [all-recursive] 错误 1
-------------------------------------------------------------------------------------------------
这个问题比较诡异,我还没有搞清楚怎么回事。
gedit Makefile,打开Makefile文件,找到“-Dmalloc=rpl_malloc”,然后删除它,接着make clean && make,编译就可以通过了。
然后执行make install,所需要的bin和库文件就在build下面生成了。
使用Android NDK编译m3u8(2)
内容版权声明:除非注明,否则皆为本站原创文章。
转载注明出处:http://www.heiqu.com/8142b604edf61d5d707743b61231b473.html