我需要在我的 android 项目中使用 fftw3 库。该库是使用本指南中稍作修改的脚本编译的
这里是
INSTALL_DIR="`pwd`/jni/fftw3"
SRC_DIR="`pwd`/../fftw-3.3.2"
NDK_ROOT=$ANDROID_NDK
echo $INSTALL_DIR
echo $SRC_DIR
cd $SRC_DIR
export PATH="$NDK_ROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/:$PATH"
export SYS_ROOT="$NDK_ROOT/platforms/android-8/arch-arm/"
export CC="arm-linux-androideabi-gcc --sysroot=$SYS_ROOT"
export LD="arm-linux-androideabi-ld"
export AR="arm-linux-androideabi-ar"
export RANLIB="arm-linux-androideabi-ranlib"
export STRIP="arm-linux-androideabi-strip"
mkdir -p $INSTALL_DIR
./configure --host=arm-eabi --build=x86-pc-linux-gnu --prefix=$INSTALL_DIR LIBS="-lc -lgcc"
make
make install
我的android项目的jni中的目录树
ls -R
.:
Android.mk Application.mk fftw3 wavfile
./fftw3:
Android.mk bin include lib share
./fftw3/bin:
fftw-wisdom fftw-wisdom-to-conf
./fftw3/include:
fftw3.f fftw3.f03 fftw3.h fftw3l.f03 fftw3q.f03
./fftw3/lib:
libfftw3.a libfftw3.la pkgconfig
./fftw3/lib/pkgconfig:
fftw3.pc
./fftw3/share:
info man
./fftw3/share/info:
dir fftw3.info fftw3.info-1 fftw3.info-2
./fftw3/share/man:
man1
./fftw3/share/man/man1:
fftw-wisdom.1 fftw-wisdom-to-conf.1
./wavfile:
Android.mk wavfile.cpp wavfile.h
jni/Android.mk
include $(call all-subdir-makefiles)
jni/wavfile/Android.mk(wavfile自己写的.cpp和.h)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := wavfile
LOCAL_SRC_FILES := wavfile.cpp
include $(BUILD_SHARED_LIBRARY)
jni/fftw3/Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := fftw3
LOCAL_SRC_FILES := lib/libfftw3.a
LOCAL_EXPORT_C_INCLUDES := include
include $(PREBUILT_STATIC_LIBRARY)
jni/应用程序.mk
APP_STL:=gnustl_static
ndk-build 的输出
Compile++ thumb : wavfile <= wavfile.cpp
Prebuilt : libgnustl_static.a <= <NDK>/sources/cxx-stl/gnu-libstdc++/libs/armeabi/
SharedLibrary : libwavfile.so
Install : libwavfile.so => libs/armeabi/libwavfile.so
和fftw3无关。
Асс根据 ndk 文档
A prebuilt module does not build anything. However, a copy of your prebuilt
shared library will be copied into $PROJECT/obj/local, and another will be
copied and stripped into $PROJECT/libs/<abi>.
fftw3 库不存在。怎么了?
谢谢你。
.