Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build or install tpm2-tools into customized /opt/xxx directory #402

Closed
liuqun opened this issue Aug 11, 2017 · 1 comment
Closed
Assignees
Milestone

Comments

@liuqun
Copy link
Contributor

liuqun commented Aug 11, 2017

I download these source tarballs:

First, configure and build TSS with ./configure --prefix=/opt/xxx --disable-shared

tar xzf tpm2-tss-1.1.0.tar.gz 
cd tpm2-tss-1.1.0/
./bootstrap

export VENDOR=xxx
./configure --prefix=/opt/$VENDOR --disable-shared
make
sudo make install

Everything is ok.

Then build tpm2-tools with same --prefix here:

tar xzvf tpm2-tools-2.1.0.tar.gz 
cd tpm2-tools-2.1.0/
./bootstrap 

export VENDOR=xxx
./configure \
    --prefix=/opt/$VENDOR \
    --with-tcti-tabrmd=no \
    PKG_CONFIG_PATH=/opt/$VENDOR/lib/pkgconfig

Then make will report us an error:
can not find <tcti/tcti_device.h>

By the way, since I do not want to install tabrmd for some reasons, I have to set --with-tcti-tabrmd=no to disable it.

@liuqun
Copy link
Contributor Author

liuqun commented Aug 11, 2017

/opt/$VENDOR/lib/pkgconfig/*.pc doesn't work because they are pointing to some wrong directories (which is /opt/xxx/include/tcit/ and /opt/xxx/include/sapi/)

The correct directory should be set with TPM20_TSS_CFLAGS=-I/opt/$VENDOR/include
But sadly, setting TPM20_TSS_CFLAGS here also doesn't work due to the behavior of Automake.

The only bash env I can use is TCTI_TABRMD_xxxx

Set TCTI_TABRMD_CFLAGS=-I/opt/$VENDOR/include and TCTI_TABRMD_LIBS=-L/opt/$VENDOR/lib will work for me.

Here is the ugly solution I've got today:

tar xzvf tpm2-tools-2.1.0.tar.gz
cd tpm2-tools-2.1.0/
./bootstrap
export VENDOR=xxx
./configure \
    --prefix=/opt/$VENDOR \
    --with-tcti-tabrmd=no \
    PKG_CONFIG_PATH=/opt/$VENDOR/lib/pkgconfig \
    TCTI_TABRMD_CFLAGS=-I/opt/$VENDOR/include     TCTI_TABRMD_LIBS=-L/opt/$VENDOR/lib

@williamcroberts williamcroberts self-assigned this Aug 11, 2017
@williamcroberts williamcroberts added this to the next milestone Aug 11, 2017
liuqun pushed a commit to liuqun/tpm2-tss that referenced this issue Aug 14, 2017
@Prefix@/lib/pkgconfig/*.pc doesn't work because Cflags are pointing to the sub-directories
The correct directory should be @includedir@ (instead of @includedir@/tcit/ or @includedir@/sapi/)
I have post a related issue for tpm2-tools, see:
"Cannot build or install tpm2-tools into customized /opt/xxx directory"
tpm2-software/tpm2-tools#402

Signed-off-by: Liu Qun (liuqun) <qunliu@zyhx-group.com>
liuqun pushed a commit to liuqun/tpm2-tss that referenced this issue Aug 14, 2017
…stomized directory, e.g. /opt/xxx

lib/pkgconfig/*.pc doesn't work because
1. "Cflags" are pointing to the sub-directories. The correct directory should be @includedir@ (instead of @includedir@/tcit/ or @includedir@/sapi/)
2. "Libs" should provide a gcc link option "-L@libdir@", in case to install libsapi.a into a customized directory

See: "Cannot build or install tpm2-tools into customized /opt/xxx directory" tpm2-software/tpm2-tools#402
Signed-off-by: Liu Qun (liuqun) <qunliu@zyhx-group.com>
flihp pushed a commit to tpm2-software/tpm2-tss that referenced this issue Aug 14, 2017
…stomized directory, e.g. /opt/xxx

lib/pkgconfig/*.pc doesn't work because
1. "Cflags" are pointing to the sub-directories. The correct directory should be @includedir@ (instead of @includedir@/tcit/ or @includedir@/sapi/)
2. "Libs" should provide a gcc link option "-L@libdir@", in case to install libsapi.a into a customized directory

See: "Cannot build or install tpm2-tools into customized /opt/xxx directory" tpm2-software/tpm2-tools#402
Signed-off-by: Liu Qun (liuqun) <qunliu@zyhx-group.com>
williamcroberts pushed a commit to williamcroberts/tpm2-tools that referenced this issue Aug 15, 2017
Configure.ac was correctly checking the sapi library via
PKG_CHECK_MODULES and thus setting SAPI_CFLAGS with the
include path. However, this was never being propagated to
AM_CFLAGS. The end result is that custom install locations
wouldn't work without hacking on CFLAGS, as it couldn't
find the sapi headers. Correct this by passing SAPI_CFLAGS
to AM_CFLAGS.

Fixes: tpm2-software#402

Signed-off-by: William Roberts <william.c.roberts@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants