I'm trying to build libiconv through the ndk. I'd never used make files before so I'm learning as I go and used this suggestion as a starting point:
https://groups.google.com/forum/#!msg/android-ndk/AS1nkxnk6m4/EQm09hD1tigJ
This is my Android.mk:
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_CLFAGS := \
-Wno-multichar \
-D_ANDROID \
-DLIBDIR="c" \
-DBUILDING_LIBICONV \
-DIN_LIBRARY \
LOCAL_SRC_FILES := \
lib/iconv.c \
lib/relocatable.c \
libcharset/lib/localcharset.c
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/include/ \
$(LOCAL_PATH)/lib/ \
$(LOCAL_PATH)/libcharset/include/ \
LOCAL_MODULE := libiconv
include $(BUILD_STATIC_LIBRARY)
The issue I'm having is that none of the defines exist when it compiles. LIBDIR is the first problem as it reaches localcharset.c:
#ifndef LIBDIR
# include "configmake.h"
#endif
.
localcharset.c: In function 'get_charset_aliases':
localcharset.c:136:15: error: 'LIBDIR' undeclared (first use in this function)
localcharset.c:136:15: note: each undeclared identifier is reported only once
and can't find configmake.h. I bypassed this issue and ran into more define related issues. Basically none of the flags were defined. Anyone know what I did wrong or why it might not define?
The quotes needed to be escaped. I couldn't find this in the documentations.
-DLIBDIR=\"c\"