在ubuntu12.04和14.04上编译openpts,遇到了很多无语的问题。现将一些过程记录。
1、获取源码
我的源码是openpts-0.2.6版本,
http://openpts.osdn.jp/
2、解压源码包
tar xvf openpts-0.2.6.tar.gz
3、根据README来编译
1)、安装必要的包。
sudo apt-get install automake autoconf libtool cvs fakeroot debhelper gettext trousers libtspi-dev tpm-tools
libxml2 libxml2-dev libuuid1 uuid-dev check
2)、根据错误安装别的包
apt-get install autopoint
3)、根据错误修改源码
4、这是折腾很久的问题,也查了很多资料,求教了很多人,没有任何办法。分析了很多遍makefile
错误信息如下:
make[1]: 正在进入目录 `/home/lw/lw_work/openpts/openpts-0.2.6/src'
/bin/bash ../libtool --tag=CC --mode=link gcc -g -O2 -DPTS_VER_MAJOR=2 -DPTS_VER_MINOR=6 -DPTS_SPEC_MAJOR=0 -DPTS_SPEC_MINOR=0 -DOPENPTS_PCR_INDEX=11 -m64 -Wall -Werror -Wreturn-type -Wsign-compare -lxml2 -lcrypto -ltspi -lopenpts -luuid -o openpts openpts-openpts.o
libtool: link: gcc -g -O2 -DPTS_VER_MAJOR=2 -DPTS_VER_MINOR=6 -DPTS_SPEC_MAJOR=0 -DPTS_SPEC_MINOR=0 -DOPENPTS_PCR_INDEX=11 -m64 -Wall -Werror -Wreturn-type -Wsign-compare -o .libs/openpts openpts-openpts.o /usr/lib/x86_64-linux-gnu/libxml2.so -lcrypto -ltspi /home/lw/lw_work/openpts/openpts-0.2.6/src/.libs/libopenpts.so -luuid -Wl,-rpath -Wl,/usr/lib64
/home/lw/lw_work/openpts/openpts-0.2.6/src/.libs/libopenpts.so: undefined reference to `Tspi_Context_FreeMemory'
/home/lw/lw_work/openpts/openpts-0.2.6/src/.libs/libopenpts.so: undefined reference to `Tspi_Context_Close'
/home/lw/lw_work/openpts/openpts-0.2.6/src/.libs/libopenpts.so: undefined reference to `BN_hex2bn'
/home/lw/lw_work/openpts/openpts-0.2.6/src/.libs/libopenpts.so: undefined reference to `Tspi_GetAttribData'
/home/lw/lw_work/openpts/openpts-0.2.6/src/.libs/libopenpts.so: undefined reference to `BN_set_word'
/home/lw/lw_work/openpts/openpts-0.2.6/src/.libs/libopenpts.so: undefined reference to `xmlFreeTextWriter'
/home/lw/lw_work/openpts/openpts-0.2.6/src/.libs/libopenpts.so: undefined reference to `Tspi_GetPolicyObject'
/home/lw/lw_work/openpts/openpts-0.2.6/src/.libs/libopenpts.so: undefined reference to `xmlTextWriterWriteFormatElement'
/home/lw/lw_work/openpts/openpts-0.2.6/src/.libs/libopenpts.so: undefined reference to