[ 移植 ] ___ Library : Xml2

[ 移植 ] ___ Library : Xml2

简介


  • 具有MIT许可证的免费软件;
  • Gnome项目开发的XML C解析器和工具包;
  • 各种语言绑定该库使其在其他环境中可用,是用C编写的;
  • 是一种用于设计标记语言的元语言。

获取


通过官方分发页面获取

构建


  • 查看README.md,了解是否需要安装依赖项;
## Dependencies

Libxml does not require any other libraries. A platform with somewhat
recent POSIX support should be sufficient (please report any violation
to this rule you may find).

However, if found at configuration time, libxml will detect and use
the following libraries:

- [libz](https://zlib.net/), a highly portable and widely available
  compression library.
- [liblzma](https://tukaani.org/xz/), another compression library.
- [libiconv](https://www.gnu.org/software/libiconv/), a character encoding
  conversion library. The iconv function is part of POSIX.1-2001, so
  libiconv isn't required on modern UNIX-like systems like Linux, BSD or
  macOS.
- [ICU](https://icu.unicode.org/), a Unicode library. Mainly useful as an
  alternative to iconv on Windows. Unnecessary on most other systems.

可以通过--with-PACKAGE--without-PACKAGE参数进行开启和关闭使用PACKAGE库。

  • 创建安装目录,安装依赖项,并解压源码包进入目录进行配置
localhost@linux:~$ mkdir ${HOME}/xml2arm
localhost@linux:~$ sudo apt install build-essential autoconf automake libtool automake pkg-config python-dev
localhost@linux:~$ tar zxvf tar zxvf libxml2-x.y.z.tar.gz
localhost@linux:~$ cd libxml2-x.y.z
localhost@linux:~/libxml2-x.y.z$ ./autogen.sh
  • 设置编译选项;
localhost@linux:~/libxml2-x.y.z$ ./configure --prefix=${HOME}/xml2arm --host=arm-none-linux-gnueabi --with-zlib=${HOME}/zlib2arm --with-lzma=${HOME}/xz2arm --with-iconv=${HOME}/iconv2arm --with-icu=${HOME}/icu2arm --without-python
  • 编译并安装;
localhost@linux:~/libxml2-x.y.z$ make
localhost@linux:~/libxml2-x.y.z$ make install
  • 整合方便后面使用。

localhost@linux:~/libxml2-x.y.z$ cp ~/zlib/* ~/xz2arm/* ~/iconv2arm/* ~/icu2arm/* ~/xml2arm -r

查看


localhost@linux:~/xml2arm$ ls -la
total 24
drwxrwxr-x  6 localhost localhost 4096 Apr 26 21:53 .
drwxr-xr-x 43 localhost localhost 4096 Apr 26 21:53 ..
drwxrwxr-x  2 localhost localhost 4096 Apr 26 21:53 bin
drwxrwxr-x  3 localhost localhost 4096 Apr 26 23:53 include
drwxrwxr-x  4 localhost localhost 4096 Apr 26 23:53 lib
drwxrwxr-x  6 localhost localhost 4096 Apr 26 23:53 share
localhost@linux:~/xml2arm$ tree
.
.
.
119 directories, 721 files
localhost@linux:~/xml2arm$ cd lib
localhost@linux:~/xml2arm/lib$ file libxml2.so.2.9.14
libxml2.so.2.9.14: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, with debug_info, not stripped

确认无误后,即可将对应的库文件和可执行程序上传到开发板的lib目录和bin目录中使用,当然也可以配合其他库文件进行相关的移植。

资料


GNOME for LibXml2

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值