summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorSamuel Lidén Borell <samuel@slbdata.se>2010-09-17 21:30:32 +0200
committerSamuel Lidén Borell <samuel@slbdata.se>2010-09-17 21:30:32 +0200
commit74b1c3f39c2e3173ba3db6e23833b38860d2614a (patch)
tree9b76bd1da199285e47f7206c745c2ae2e983caf8 /configure
parent5a7fda340fe2ee1d4d89d36a2475bf52abf40f21 (diff)
downloadfribid-74b1c3f39c2e3173ba3db6e23833b38860d2614a.tar.gz
fribid-74b1c3f39c2e3173ba3db6e23833b38860d2614a.tar.bz2
fribid-74b1c3f39c2e3173ba3db6e23833b38860d2614a.zip
Improve support for detecting the pkcs11 module at runtime
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure21
1 files changed, 17 insertions, 4 deletions
diff --git a/configure b/configure
index fec054e..8ef52e0 100755
--- a/configure
+++ b/configure
@@ -40,6 +40,8 @@ pluginPaths="/usr/$multilib/mozilla/plugins"
userPluginPath="$HOME/.mozilla/plugins"
userPrefix="$HOME/.local"
+enable_pkcs11=""
+optional_pkcs11="0"
pkcs11Engine="/usr/$multilib/opensc-pkcs11.so"
error=""
@@ -72,6 +74,7 @@ Options:
--pkcs11-engine=PATH Path to pkcs11 engine [/usr/$multilib/opensc-pkcs11.so]
--disable-pkcs11 Disable building pkcs11 smartcard support [default autodetect]
--enable-pkcs11 Force building pkcs11 smartcard support [default autodetect]
+ --optional-pkcs11 Detect pkcs11 module availability at runtime
--current-user Selects a per-user installation. Equivalent to:
--prefix=$userPrefix
--plugin-path=$userPluginPath
@@ -106,10 +109,13 @@ Options:
;;
--disable-pkcs11)
enable_pkcs11="0"
- ;;
+ ;;
--enable-pkcs11)
enable_pkcs11="1"
- ;;
+ ;;
+ --optional-pkcs11)
+ optional_pkcs11="1"
+ ;;
--current-user)
if [ -z "$prefixSet" ]; then
prefix="$userPrefix"
@@ -220,8 +226,14 @@ if [ "$enable_pkcs11" = 1 ]; then
echo "pkcs11 smartcard support enabled"
pkgconfigDeps="$pkgconfigDeps;libp11"
if [ ! -f $pkcs11Engine ]; then
- echo "Error: $pkcs11Engine not found"
- depError=1
+ # PKCS#11 module not found
+ errorType="Warning"
+ if [ "$optional_pkcs11" = 0 ]; then
+ errorType="Error"
+ depError=1
+ fi
+
+ echo "$errorType: $pkcs11Engine not found"
fi
else
echo "pkcs11 smartcard support disabled"
@@ -258,6 +270,7 @@ cat <<EOT >"$CONFFILE"
#define DEFAULT_PKCS11_ENGINE "$pkcs11Engine"
#define ENABLE_PKCS11 ${enable_pkcs11:-0}
+#define OPTIONAL_PKCS11 ${optional_pkcs11:-0}
EOT
### Display success message