Libxml porting to Android

Source: Internet
Author: User

Libxml is the C-language XML parsing library, which is our first choice for developing portable programs, and the steps to porting them to Android are described below

1. Download the already configured source code package Android_libxml2.rar

Http://pan.baidu.com/s/1sjpusFj

The package also has the character Transcoding library libiconv that LIBXML2 relies on, and is also well-configured. All we do is compile first.

Libiconv, and then compile libxml2, of course, a compilation is also possible.

2. First rename the Libiconv to JNI, use the command line to enter the current directory, execute the Ndk-build

3. When renaming libxml2 to JNI, use the command line to enter the current directory and execute Ndk-build

4. Under Obj/local/armeabi, we'll generate the static libraries we need.

Here are the Mk files for libxml2 and Libiconv:

#libiconv. mk##################################

Local_path:= $ (call My-dir)
Include $ (clear_vars)

Local_cflags: = \
-wno-multichar \
-dandroid \
-dlibdir= "C" \
-dbuilding_libiconv \
-din_library

Local_src_files: = \
LIBCHARSET/LIB/LOCALCHARSET.C \
LIB/ICONV.C \
Lib/relocatable.c

Local_c_includes + = \
$ (local_path)/include \
$ (local_path)/libcharset \
$ (local_path)/lib \
$ (local_path)/libcharset/include \
$ (Local_path)/srclib

Local_prelink_module: = False
Local_module_tags: = Optional
Local_module: = Libiconv
Include $ (build_static_library)

#libxml2. mk##################################

Local_path:= $ (call My-dir)
Include $ (clear_vars)

Local_src_files: = \
C14N.C catalog.c chvalid.c debugxml.c dict.c docbparser.c \
ENCODING.C entities.c error.c globals.c hash.c htmlparser.c \
htmltree.c legacy.c list.c nanoftp.c nanohttp.c parser.c \
PARSERINTERNALS.C pattern.c relaxng.c sax.c sax2.c \
THREADS.C tree.c trionan.c triostr.c uri.c valid.c\
xinclude.c xlink.c xmlio.c xmlmemory.c xmlmodule.c \
XMLREADER.C xmlregexp.c xmlsave.c xmlschemas.c xmlschemastypes.c xmlstring.c \
xmlunicode.c xmlwriter.c xpath.c xpointer.c

Local_c_includes: = \
$ (local_path)/include \
$ (Local_path)/include/libxml\
$ (Local_path)/.. /libiconv/include \
$ (Local_path)/.. /libiconv \
$ (Local_path)/.. /libiconv/libcharset \
$ (Local_path)/.. /libiconv/lib \
$ (Local_path)/.. /libiconv/libcharset/include

Local_prelink_module: = False
Local_module_tags: = Optional

Local_cflags: =-l$ (Local_path) \
-l$ (Local_path)/. /obj/local/armeabi
Local_static_libraries: = Iconv
Local_module:=libxml2
Include $ (build_static_library)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.