ndk编译iconv

需要注意的是libiconv的根目录名要改为jni,才能正常编译,否则提示NDK_PROJECT_PATH未定义,然后停止编译

iconv  (转自 http://www.huyinqiu.com/dokuwiki/android/ndk%E7%BC%96%E8%AF%91iconv

下载地址:libiconv-1.14

环境配置:

  1. $ NDK=/path/to/ndk
    $ export PATH=$PATH:$NDK/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/
    $ ./configure --host=arm-eabi CC=arm-linux-androideabi-gcc CPPFLAGS="-I$NDK/platforms/android-9/arch-arm/usr/include/" CFLAGS="-nostdlib" LDFLAGS="-Wl,-rpath-link=$NDK/platforms/android-9/arch-arm/usr/lib/ -L$NDK/platforms/android-9/arch-arm/usr/lib/" LIBS="-lc"

Android.mk

Android.mk
LOCAL_PATH:= $(call my-dir)
LIBICONV_PATH:=$(LOCAL_PATH)
 
include $(CLEAR_VARS)
LOCAL_MODULE := iconv
LOCAL_CFLAGS := \
	-Wno-multichar \
	-D_ANDROID \
	-DLIBDIR=\"\" \
	-DBUILDING_LIBICONV \
	-DIN_LIBRARY
 
LOCAL_C_INCLUDES := \
	$(LIBICONV_PATH)/ \
	$(LIBICONV_PATH)/include \
	$(LIBICONV_PATH)/lib \
	$(LIBICONV_PATH)/libcharset/include
 
LOCAL_SRC_FILES := \
	libcharset/lib/localcharset.c \
	lib/iconv.c \
	lib/relocatable.c
include $(BUILD_SHARED_LIBRARY)
发布了196 篇原创文章 · 获赞 115 · 访问量 120万+
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 撸撸猫 设计师: 设计师小姐姐

分享到微信朋友圈

×

扫一扫,手机浏览