https://github.com/HardySimpson/zlog/releases
$ ./configure --prefix=/opt/armlib_mipsel/libzlog --host=mipsel-openwrt-linux CC=mipsel-openwrt-linux-gcc
$ make
$ make install
prefix
:安装路径设置
host
:运行环境设置
CC
:工具链设置
$ make
Making all in doc
make[1]: Entering directory '/opt/armsrc/zlog/doc'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/opt/armsrc/zlog/doc'
Making all in src
make[1]: Entering directory '/opt/armsrc/zlog/src'
../mipsel-openwrt-linux-libtool --tag=CC --mode=link mipsel-openwrt-linux-gcc -I. -g -O2 -o zlog-chk-conf zlog_chk_conf-zlog-chk-conf.o libzlog.la -lpthread
mipsel-openwrt-linux-libtool: link: mipsel-openwrt-linux-gcc -I. -g -O2 -o .libs/zlog-chk-conf zlog_chk_conf-zlog-chk-conf.o ./.libs/libzlog.so -lpthread -Wl,-rpath -Wl,/opt/armlib_mipsel/libzlog/lib
./.libs/libzlog.so: undefined reference to `rpl_realloc'
collect2: error: ld returned 1 exit status
Makefile:501: recipe for target 'zlog-chk-conf' failed
make[1]: *** [zlog-chk-conf] Error 1
make[1]: Leaving directory '/opt/armsrc/zlog/src'
Makefile:429: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
问题:没有rpl_realloc,修改根目录与src目录下的Makefile,将“rpl_realloc”修改为“realloc”,修改后要make clean再make
$ make clean
$ make
zlog使用手册,该手册介绍详细了zlog的方法,很实用
下载源码后
cd 到文件夹下,对 autogen.sh 添加可执行权限:chmod +x autogen.sh
然后执行:./autogen.sh
如果出现不能识别的函数错误,或报”Syntax error: “(” unexpected 的错误,请取消dash:
dpkg-reconfigure dash
选择 no ;然后再执行:./autogen.sh