Dear Alberto,
I realized that there was something missing, so I added CPPFLAGS varible
to include some path needed.

NDK_ROOT=/home/aaraujo/desarrollo/andriod/android/ndk/
API_LEVEL=8
SYSROOT=$NDK_ROOT/platforms/android-$API_LEVEL/arch-arm
export
CC="$NDK_ROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc-4.4.3"
export
CXX="$NDK_ROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-g++"
export CFLAGS="--sysroot=$SYSROOT"
export LDFLAGS="--sysroot=$SYSROOT"
export
CPPFLAGS="-I$NDK_ROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.4.3/include-fixed
-I$NDK_ROOT/platforms/android-8/arch-arm/usr/include"

After issue the configure command I get an error about transcoder:

./configure --host=arm-linux-gnueabi --enable-static --disable-shared

...
checking unicode/ucnv.h usability... no
checking unicode/ucnv.h presence... no
checking for unicode/ucnv.h... no
checking iconv.h usability... yes
checking iconv.h presence... yes
checking for iconv.h... yes
checking for wchar.h... (cached) yes
checking for string.h... (cached) yes
checking for stdlib.h... (cached) yes
checking stdio.h usability... yes
checking stdio.h presence... yes
checking for stdio.h... yes
checking ctype.h usability... yes
checking ctype.h presence... yes
checking for ctype.h... yes
checking for locale.h... (cached) yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking for endian.h... (cached) yes
checking for iconv_open... no
checking for iconv_close... no
checking for iconv... no
checking whether we can support the GNU iconv Transcoder... no
checking for wchar.h... (cached) yes
checking for mblen... (cached) no
checking for wcstombs... yes
checking for mbstowcs... yes
checking whether we can support the iconv Transcoder... no
checking whether we can support the ICU Transcoder... no
checking for which Transcoder to use (choices:)... none
configure: error: Xerces cannot function without a transcoder


I downloaded libiconv-1.14.tar.gz to port to arm. After read
https://groups.google.com/forum/?fromgroups=#!topic/android-ndk/M5XedQm0bvQ
<https://groups.google.com/forum/?fromgroups=#%21topic/android-ndk/M5XedQm0bvQ>
I could build libiconv.a.


I read the config.log file and I saw that there was an undefined
reference to iconv_open function:

...
configure:18224: checking for iconv_open
configure:18224:
/home/aaraujo/desarrollo/andriod/android/ndk//toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-g++
-o conftest  
-I/home/aaraujo/desarrollo/andriod/android/ndk//toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.4.3/include-fixed
-I/home/aaraujo/desarrollo/andriod/android/ndk//platforms/android-8/arch-arm/usr/include
--sysroot=/home/aaraujo/desarrollo/andriod/android/ndk//platforms/android-8/arch-arm
/home/aaraujo/desarrollo/andriod/android/ndk/platforms/android-8/arch-arm/usr/lib/libiconv.a
conftest.cpp   >&5
/tmp/cc00uoYk.o: In function `main':
conftest.cpp:(.text+0x8): undefined reference to `iconv_open'
collect2: ld returned 1 exit status
configure:18224: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "xerces-c"
| #define PACKAGE_TARNAME "xerces-c"
| #define PACKAGE_VERSION "3.1.1"
| #define PACKAGE_STRING "xerces-c 3.1.1"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define PACKAGE "xerces-c"
| #define VERSION "3.1.1"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define STDC_HEADERS 1
| #define TIME_WITH_SYS_TIME 1
| #define HAVE_ARPA_INET_H 1
| #define HAVE_FCNTL_H 1
| #define HAVE_FLOAT_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_LIMITS_H 1
| #define HAVE_LOCALE_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_NETDB_H 1
| #define HAVE_NETINET_IN_H 1
| #define HAVE_STDDEF_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_SYS_PARAM_H 1
| #define HAVE_SYS_SOCKET_H 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_SYS_TIMEB_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_WCHAR_H 1
| #define HAVE_WCTYPE_H 1
| #define HAVE_ENDIAN_H 1
| #define HAVE_STDBOOL_H 1
| #define SIZEOF_WCHAR_T 4
| #define HAVE_INTTYPES_H 1
| #define SIZEOF_SHORT 2
| #define SIZEOF_INT 4
| #define SIZEOF_LONG 4
| #define SIZEOF_LONG_LONG 8
| #define SIZEOF___INT64 0
| #define XERCES_S16BIT_INT int16_t
| #define XERCES_U16BIT_INT uint16_t
| #define XERCES_S32BIT_INT int32_t
| #define XERCES_U32BIT_INT uint32_t
| #define XERCES_S64BIT_INT int64_t
| #define XERCES_U64BIT_INT uint64_t
| #define HAVE_BOOL /**/
| #define HAVE_NAMESPACES /**/
| #define HAVE_LSTRING /**/
| #define HAVE_PTHREAD 1
| #define HAVE_GETCWD 1
| #define HAVE_PATHCONF 1
| #define HAVE_REALPATH 1
| #define HAVE_GETADDRINFO 1
| #define HAVE_GETHOSTBYADDR 1
| #define HAVE_GETHOSTBYNAME 1
| #define HAVE_SOCKET 1
| #define HAVE_CLOCK_GETTIME 1
| #define HAVE_FTIME 1
| #define HAVE_GETTIMEOFDAY 1
| #define HAVE_MEMMOVE 1
| #define HAVE_MEMSET 1
| #define HAVE_SETLOCALE 1
| #define HAVE_STRCASECMP 1
| #define HAVE_STRNCASECMP 1
| #define HAVE_STRCHR 1
| #define HAVE_STRDUP 1
| #define HAVE_STRRCHR 1
| #define HAVE_STRSTR 1
| #define HAVE_STRTOL 1
| #define HAVE_STRTOUL 1
| #define HAVE_TOWUPPER 1
| #define HAVE_TOWLOWER 1
| #define HAVE_MBRLEN 1
| #define HAVE_WCSRTOMBS 1
| #define HAVE_MBSRTOWCS 1
| #define ICONV_USES_CONST_POINTER 0
| #define HAVE_TOWLOWER 1
| #define HAVE_TOWUPPER 1
| #define XERCES_USE_MUTEXMGR_POSIX 1
| #define XERCES_USE_NETACCESSOR_SOCKET 1
| #define HAVE_ICONV_H 1
| #define HAVE_WCHAR_H 1
| #define HAVE_STRING_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STDIO_H 1
| #define HAVE_CTYPE_H 1
| #define HAVE_LOCALE_H 1
| #define HAVE_ERRNO_H 1
| /* end confdefs.h.  */
| /* Define iconv_open to an innocuous variant, in case <limits.h>
declares iconv_open.
|    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
| #define iconv_open innocuous_iconv_open
|
| /* System header to define __stub macros and hopefully few prototypes,
|     which can conflict with char iconv_open (); below.
|     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
|     <limits.h> exists even on freestanding compilers.  */
|
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
|
| #undef iconv_open
|
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char iconv_open ();
| /* The GNU C library defines this for functions which it implements
|     to always fail with ENOSYS.  Some functions are actually named
|     something starting with __ and the normal name is an alias.  */
| #if defined __stub_iconv_open || defined __stub___iconv_open
| choke me
| #endif
|
| int
| main ()
| {
| return iconv_open ();
|   ;
|   return 0;
| }
configure:18224: result: no


Is it possible to build xerces-c with iconv as transcoder?.

I added the path of libiconv.a library built previously in LDFLAGS
variable. The compilation line is the following:

configure:18224:
/home/aaraujo/desarrollo/andriod/android/ndk//toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-g++
-o conftest  
-I/home/aaraujo/desarrollo/andriod/android/ndk//toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.4.3/include-fixed
-I/home/aaraujo/desarrollo/andriod/android/ndk//platforms/android-8/arch-arm/usr/include
--sysroot=/home/aaraujo/desarrollo/andriod/android/ndk//platforms/android-8/arch-arm
/home/aaraujo/desarrollo/andriod/android/ndk/platforms/android-8/arch-arm/usr/lib/libiconv.a
conftest.cpp   >&5

Is this line right?

Thanks for your comments

Antonio


El 17/01/13 15:06, Antonio Araujo Brett escribió:
> Alberto,
> I think you are right. It appears that there is something missing.
> Thanks for your help.
>
> Best regards
>
> Antonio
>
>
>
>
>
>
> El 17/01/13 14:41, Alberto Massari escribió:
>   
>> From what I see ("error: sys/cdefs.h: No such file or directory")
>> there is something wrong with locating the header files containing the
>> needed definitions. But I don't really know how the NDK cross-compiler
>> is supposed to work, so I can't help you further...
>>
>> Alberto 
>>     

Reply via email to