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



Il 17/01/13 19:57, Antonio Araujo Brett ha scritto:
Dear Alberto, thanks for your comments.
I tested the command with that options but I still get the error:

configure:16122: error: Couldn't find a signed 16 bit int type

The program of conftest.cpp that fails is:

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 HAVE_INTTYPES_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_STDBOOL_H 1
| #define SIZEOF_WCHAR_T 0
| #define off_t long int
| #define size_t unsigned int
| #define HAVE_INTTYPES_H 1
| #define SIZEOF_SHORT 0
| #define SIZEOF_INT 0
| #define SIZEOF_LONG 0
| #define SIZEOF_LONG_LONG 0
| #define SIZEOF___INT64 0
| /* end confdefs.h.  */
| #include <stdio.h>
| #ifdef HAVE_SYS_TYPES_H
| # include <sys/types.h>
| #endif
| #ifdef HAVE_SYS_STAT_H
| # include <sys/stat.h>
| #endif
| #ifdef STDC_HEADERS
| # include <stdlib.h>
| # include <stddef.h>
| #else
| # ifdef HAVE_STDLIB_H
| #  include <stdlib.h>
| # endif
| #endif
| #ifdef HAVE_STRING_H
| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
| #  include <memory.h>
| # endif
| # include <string.h>
| #endif
| #ifdef HAVE_STRINGS_H
| # include <strings.h>
| #endif
| #ifdef HAVE_INTTYPES_H
| # include <inttypes.h>
| #endif
| #ifdef HAVE_STDINT_H
| # include <stdint.h>
| #endif
| #ifdef HAVE_UNISTD_H
| # include <unistd.h>
| #endif
| int
| main ()
| {
| if (sizeof (uint64_t))
|      return 0;
|   ;
|   return 0;
| }

Regards

Antonio









El 17/01/13 12:12, Alberto Massari escribió:
Hi Antonio,
I'm not an expert of cross-compilers, but I found these references on
the net:

<<<<<<<<<<<<
Make sure and add |--sysroot=$SYSROOT| to |CFLAGS| and/or |CXXFLAGS|.

Now you need to tell |configure| that you are cross compiling:

|./configure--build=x86_64-unknown-linux-gnu--host=arm-linux-androideabi--target=arm-linux-androideabi|


Alberto

Il 17/01/13 17:30, Antonio Araujo Brett ha scritto:
Dear friends of list, I hope you are fine.

I want to port the xerces-c library to Android using NDK-r8c. This is
what I am doing:

*- Get the sources xerces-c-3.1.1.tar.gz
*- Define the following variables:

NDK_ROOT=/path/to/ndk-r8c

API_LEVEL=8

SYSROOT=$NDK_ROOT/platforms/android-8/arch-arm

export
CC="$NDK_ROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc"


export
CXX="$NDK_ROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-g++"


*- When I run configure script:

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

I get the following error:

...
checking for int16_t... no
checking for int32_t... no
checking for int64_t... no
checking for uint16_t... no
checking for uint32_t... no
checking for uint64_t... no
checking for an appropriate signed 16 bit integer type... configure:
error: Couldn't find a signed 16 bit int type

After read previous mails from the list, I checked the config.log file
in order to see what was wrong. Please excuse this long output:

...
configure:16098:
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-g++

-c -g -O2  conftest.cpp >&5
In file included from conftest.cpp:41:
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/stdio.h:50:23:

error: sys/cdefs.h: No such file or directory
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/stdio.h:51:24:

error: sys/_types.h: No such file or directory
In file included from conftest.cpp:43:
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:43:20:

error: stdint.h: No such file or directory
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:46:31:

error: linux/posix_types.h: No such file or directory
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:47:23:

error: asm/types.h: No such file or directory
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:48:25:

error: linux/types.h: No such file or directory
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:49:28:

error: machine/kernel.h: No such file or directory
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:126:27:

error: sys/sysmacros.h: No such file or directory
conftest.cpp:46:23: error: sys/stat.h: No such file or directory
conftest.cpp:49:21: error: stdlib.h: No such file or directory
conftest.cpp:60:21: error: string.h: No such file or directory
conftest.cpp:63:22: error: strings.h: No such file or directory
conftest.cpp:66:23: error: inttypes.h: No such file or directory
conftest.cpp:72:21: error: unistd.h: No such file or directory
In file included from conftest.cpp:41:
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/stdio.h:74:

error: declaration does not declare anything
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/stdio.h:163:

error: expected constructor, destructor, or type conversion before
'extern'
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/stdio.h:164:

error: '__END_DECLS' does not name a type
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/stdio.h:301:

error: '__END_DECLS' does not name a type
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/stdio.h:393:

error: expected constructor, destructor, or type conversion before
'static'
In file included from conftest.cpp:43:
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:51:

error: '__u32' does not name a type
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:61:

error: '__kernel_blkcnt_t' does not name a type
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:62:

error: '__kernel_blksize_t' does not name a type
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:63:

error: '__kernel_clock_t' does not name a type
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:64:

error: '__kernel_clockid_t' does not name a type
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:65:

error: '__kernel_dev_t' does not name a type
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:66:

error: '__kernel_fsblkcnt_t' does not name a type
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:67:

error: '__kernel_fsfilcnt_t' does not name a type
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:68:

error: '__kernel_gid32_t' does not name a type
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:69:

error: '__kernel_id_t' does not name a type
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:70:

error: '__kernel_ino_t' does not name a type
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:71:

error: '__kernel_key_t' does not name a type
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:72:

error: '__kernel_mode_t' does not name a type
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:73:

error: '__kernel_nlink_t' does not name a type
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:78:

error: '__kernel_loff_t' does not name a type
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:79:

error: 'loff_t' does not name a type
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:81:

error: '__kernel_pid_t' does not name a type
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:112:

error: '__kernel_suseconds_t' does not name a type
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:113:

error: '__kernel_time_t' does not name a type
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:114:

error: '__kernel_uid32_t' does not name a type
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:117:

error: '__kernel_daddr_t' does not name a type
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:118:

error: '__kernel_timer_t' does not name a type
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:119:

error: '__kernel_mqd_t' does not name a type
/home/aaraujo/desarrollo/andriod/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:121:

error: '__kernel_caddr_t' does not name a type
conftest.cpp: In function 'int main()':
conftest.cpp:77: error: 'uint64_t' was not declared in this scope
configure:16098: $? = 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 HAVE_INTTYPES_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_STDBOOL_H 1
| #define SIZEOF_WCHAR_T 0
| #define off_t long int
| #define size_t unsigned int
| #define HAVE_INTTYPES_H 1
| #define SIZEOF_SHORT 0
| #define SIZEOF_INT 0
| #define SIZEOF_LONG 0
| #define SIZEOF_LONG_LONG 0
| #define SIZEOF___INT64 0
| /* end confdefs.h.  */
| #include <stdio.h>
| #ifdef HAVE_SYS_TYPES_H
| # include <sys/types.h>
| #endif
| #ifdef HAVE_SYS_STAT_H
| # include <sys/stat.h>
| #endif
| #ifdef STDC_HEADERS
| # include <stdlib.h>
| # include <stddef.h>
| #else
| # ifdef HAVE_STDLIB_H
| #  include <stdlib.h>
| # endif
| #endif
| #ifdef HAVE_STRING_H
| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
| #  include <memory.h>
| # endif
| # include <string.h>
| #endif
| #ifdef HAVE_STRINGS_H
| # include <strings.h>
| #endif
| #ifdef HAVE_INTTYPES_H
| # include <inttypes.h>
| #endif
| #ifdef HAVE_STDINT_H
| # include <stdint.h>
| #endif
| #ifdef HAVE_UNISTD_H
| # include <unistd.h>
| #endif
| int
| main ()
| {
| if (sizeof (uint64_t))
|      return 0;
|   ;
|   return 0;
| }
configure:16098: result: no
configure:16107: checking for an appropriate signed 16 bit integer type
configure:16122: error: Couldn't find a signed 16 bit int type

Could anyone please help to identify the error source?

Best regards

Antonio








Reply via email to