编译Android版本的libmad
2011-10-23 00:22
204 查看
1、 下载libmad源码
2、 在目录C:\cygwin\home\Administrator\android-ndk-r4b-windows\android-ndk-r4b\samples\下创建目录jni,并把libmad的源码解压到该目录下,这样mad.h的目录是:C:\cygwin\home\Administrator\android-ndk-r4b-windows\android-ndk-r4b\samples\libmad\jni\libmad-0.15.1b
3、 在jni目录下建立Android.mk内容:
include$(all-subdir-makefiles)
4、 在jni/libmad-0.15.1b目录下建立Android.mk,内容:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := mad
LOCAL_ARM_MODE := arm
LOCAL_SRC_FILES := bit.c decoder.c fixed.c frame.c huffman.c layer12.clayer3.c stream.c synth.c timer.c version.c
LOCAL_CFLAGS := -DH***E_CONFIG_H -DFPM_ARM -ffast-math -O3
include $(BUILD_SHARED_LIBRARY)
5、 启动Cygwin,到目录samples下
6、 执行:../ndk-build NDK_PROJECT_PATH=$NDK_ROOT/samples/libmad
注意:这里使用的config.h不是执行configure生成的,而是从网上down的一个,内容是:
2、 在目录C:\cygwin\home\Administrator\android-ndk-r4b-windows\android-ndk-r4b\samples\下创建目录jni,并把libmad的源码解压到该目录下,这样mad.h的目录是:C:\cygwin\home\Administrator\android-ndk-r4b-windows\android-ndk-r4b\samples\libmad\jni\libmad-0.15.1b
3、 在jni目录下建立Android.mk内容:
include$(all-subdir-makefiles)
4、 在jni/libmad-0.15.1b目录下建立Android.mk,内容:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := mad
LOCAL_ARM_MODE := arm
LOCAL_SRC_FILES := bit.c decoder.c fixed.c frame.c huffman.c layer12.clayer3.c stream.c synth.c timer.c version.c
LOCAL_CFLAGS := -DH***E_CONFIG_H -DFPM_ARM -ffast-math -O3
include $(BUILD_SHARED_LIBRARY)
5、 启动Cygwin,到目录samples下
6、 执行:../ndk-build NDK_PROJECT_PATH=$NDK_ROOT/samples/libmad
注意:这里使用的config.h不是执行configure生成的,而是从网上down的一个,内容是:
/* config.h. Generated by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */ /* Define to enable diagnostic debugging support. */ /* #undef DEBUG */ /* Define to enable experimental code. */ /* #undef EXPERIMENTAL */ /* Define to 1 if you have the <assert.h> header file. */ #define H***E_ASSERT_H 1 /* Define to 1 if you have the <dlfcn.h> header file. */ #define H***E_DLFCN_H 1 /* Define to 1 if you have the <errno.h> header file. */ #define H***E_ERRNO_H 1 /* Define to 1 if you have the `fcntl' function. */ #define H***E_FCNTL 1 /* Define to 1 if you have the <fcntl.h> header file. */ #define H***E_FCNTL_H 1 /* Define to 1 if you have the `fork' function. */ #define H***E_FORK 1 /* Define to 1 if you have the <inttypes.h> header file. */ #define H***E_INTTYPES_H 1 /* Define to 1 if you have the <limits.h> header file. */ #define H***E_LIMITS_H 1 /* Define if your MIPS CPU supports a 2-operand MADD16 instruction. */ /* #undef H***E_MADD16_ASM */ /* Define if your MIPS CPU supports a 2-operand MADD instruction. */ /* #undef H***E_MADD_ASM */ /* Define to 1 if you have the <memory.h> header file. */ #define H***E_MEMORY_H 1 /* Define to 1 if you have the `pipe' function. */ #define H***E_PIPE 1 /* Define to 1 if you have the <stdint.h> header file. */ #define H***E_STDINT_H 1 /* Define to 1 if you have the <stdlib.h> header file. */ #define H***E_STDLIB_H 1 /* Define to 1 if you have the <strings.h> header file. */ #define H***E_STRINGS_H 1 /* Define to 1 if you have the <string.h> header file. */ #define H***E_STRING_H 1 /* Define to 1 if you have the <sys/stat.h> header file. */ #define H***E_SYS_STAT_H 1 /* Define to 1 if you have the <sys/types.h> header file. */ #define H***E_SYS_TYPES_H 1 /* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */ #define H***E_SYS_WAIT_H 1 /* Define to 1 if you have the <unistd.h> header file. */ #define H***E_UNISTD_H 1 /* Define to 1 if you have the `waitpid' function. */ #define H***E_WAITPID 1 /* Define to disable debugging assertions. */ /* #undef NDEBUG */ /* Define to optimize for accuracy over speed. */ /* #undef OPT_ACCURACY */ /* Define to optimize for speed over accuracy. */ #define OPT_SPEED 1 /* Define to enable a fast subband synthesis approximation optimization. */ /* #undef OPT_SSO */ /* Define to influence a strict interpretation of the ISO/IEC standards, even if this is in opposition with best accepted practices. */ /* #undef OPT_STRICT */ /* Name of package */ #define PACKAGE "libmad" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "support@underbit.com" /* Define to the full name of this package. */ #define PACKAGE_NAME "MPEG Audio Decoder" /* Define to the full name and version of this package. */ #define PACKAGE_STRING "MPEG Audio Decoder 0.15.1b" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "libmad" /* Define to the version of this package. */ #define PACKAGE_VERSION "0.15.1b" /* The size of a `int', as computed by sizeof. */ #define SIZEOF_INT 4 /* The size of a `long', as computed by sizeof. */ #define SIZEOF_LONG 4 /* The size of a `long long', as computed by sizeof. */ #define SIZEOF_LONG_LONG 8 /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Version number of package */ #define VERSION "0.15.1b" /* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ /* #undef WORDS_BIGENDIAN */ /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus /* #undef inline */ #endif /* Define to `int' if <sys/types.h> does not define. */ /* #undef pid_t */
相关文章推荐
- 如何指定让Android的NDK工具编译出Release版本或Debug版本的Native程序
- FFmpeg全新系列之3.2.2版本于CentOS6.5安装并实现Android移植编译-秒懂-你-逆袭必备
- android编译时Notification版本引起的错误
- 编译android版本pjsip
- OpenCV4Android在2.x版本中不使用OpenCVManager以及编译SIFT算法实现
- windows下编译Android版本的boost库文件
- 高版本的Ubuntu环境下android编译注意的问题
- 编译Chromium Android版本
- Ogre1.9 Android 版本编译方法
- android studio编译的时候提示gradle版本不对
- linux下编译dcmtk的Android版本
- 更改Android编译软件版本(make/gcc/bision)
- libmad 在android源码里编译
- quick-3.5创建功能编译android版本
- android和kernel编译版本显示更改
- 再一次成功编译运行android-4.3.2.1模拟器版本
- make版本不符合要求,不能编译android的解决方法
- android编译user版本,如何启用user版本的adb
- 【COCOS2DX-ANDROID-游戏开发之十八】编译android版本之添加预编译宏
- Android编译版本eng、user和userdebug的区别