Bug 40985 - libdir is not expanded and p11-kit tries to load modules from ${exec_prefix}/lib/pkcs11/
Summary: libdir is not expanded and p11-kit tries to load modules from ${exec_prefix}/...
Status: RESOLVED FIXED
Alias: None
Product: p11-glue
Classification: Unclassified
Component: p11-kit (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Stef Walter
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-18 03:24 UTC by Ionut Biru
Modified: 2011-09-25 23:33 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
patch that fixes this issue (1.45 KB, patch)
2011-09-18 03:24 UTC, Ionut Biru
Details | Splinter Review
quoting fix (621 bytes, patch)
2011-09-19 10:51 UTC, Andreas Metzler
Details | Splinter Review

Description Ionut Biru 2011-09-18 03:24:01 UTC
p11-kit: couldn't load module: ${exec_prefix}/lib/pkcs11/gnome-keyring-pkcs11.so: ${exec_prefix}/lib/pkcs11/gnome-keyring-pkcs11.so: cannot open shared object file: No such file or directory

p11-kit 0.6
Comment 1 Ionut Biru 2011-09-18 03:24:34 UTC
Created attachment 51308 [details] [review]
patch that fixes this issue
Comment 2 Damien Lespiau 2011-09-18 07:45:59 UTC
FWIW, there's a reason why you cannot expand variables depending on ${libdir} in the configure script.

It's because autoconf leaves some variables unexpended to be able to override then when running make (eg. make exec_prefix=/blah and libdir is ${exec_prefix}/lib)and thus you can only reliably defines variables depending on ${libdir} in the Makefiles.

AFAIK, the way to solve that is, instead of using config.h and expect to be able to expand variables in configure.ac, to declare #defines in the CPPFLAGS with a -D option (eg. -DP11_FOO=\""${libdir}/p11/foo"\")
Comment 3 Stef Walter 2011-09-19 00:27:31 UTC
Expanding it in the flags sounds like a good plan. Pushed a commit which does this. Could you test it to make sure it fixes the problem?

http://cgit.freedesktop.org/p11-glue/p11-kit/commit/?id=a081b6652acc9d9a9af22a266f9175f689b8c5d1
Comment 4 Andreas Metzler 2011-09-19 10:51:04 UTC
Created attachment 51366 [details] [review]
quoting fix

git head is slightly broken, the quoting is not yet correct:

------------------------------------
[...]
+ exec ./configure --build=i486-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --libexecdir=${prefix}/lib/p11-kit --disable-maintainer-mode --disable-dependency-tracking --libdir=${prefix}/lib/i386-linux-gnu
[...]
configure: build options:

    System Global Config:            /etc/pkcs11/pkcs11.conf
    System Module Config Directory:  /etc/pkcs11/modules
    User Global Config:              ~/.pkcs11/pkcs11.conf
    User Module Config Directory:    ~/.pkcs11/modules
    Load relative module paths from: ${prefix}/lib/i386-linux-gnu/pkcs11
[...]
make[2]: Entering directory `/tmp/P11-KIT/p11-kit.git/p11-kit'
  CC     util.lo
/bin/bash ../libtool --silent --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I.. -DP11_KIT_FUTURE_UNSTABLE_API -DP11_SYSTEM_CONFIG_FILE=\""/etc/pkcs11/pkcs11.conf"\" -DP11_SYSTEM_CONFIG_MODULES=\""/etc/pkcs11/modules"\" -DP11_USER_CONFIG_FILE=\""~/.pkcs11/pkcs11.conf"\" -DP11_USER_CONFIG_MODULES=\""11_user_config_modules"\" -DP11_MODULE_PATH=\""11_module_path"\"     -g -O2 		-Wall -Wstrict-prototypes -Wmissing-declarations 		-Wmissing-prototypes -Wnested-externs -Wpointer-arith 		-Wdeclaration-after-statement -Wformat=2 -Winit-self 		-Waggregate-return -Wno-missing-format-attribute -Wmissing-include-dirs -Wundef -c -o util.lo util.c
------------------------------------

Simple two-line fix attached.
Comment 5 Andreas Metzler 2011-09-24 07:31:04 UTC
reopen - see last comment
Comment 6 Stef Walter 2011-09-25 23:32:49 UTC
Comment on attachment 51366 [details] [review]
quoting fix

Thanks, merged this patch. Will prep another release soon.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.