summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorSamuel Lidén Borell <samuel@slbdata.se>2010-08-16 21:34:45 +0200
committerSamuel Lidén Borell <samuel@slbdata.se>2010-08-16 21:34:45 +0200
commit83016fd0d7821c84e46e1fc37c7669dfce8136a7 (patch)
tree01b8bc11aa7c2fa5e6a38ca948d751a8452faae6 /configure
parent2cae57c2a491a943906f758543e5655a794e480b (diff)
downloadfribid-83016fd0d7821c84e46e1fc37c7669dfce8136a7.tar.gz
fribid-83016fd0d7821c84e46e1fc37c7669dfce8136a7.tar.bz2
fribid-83016fd0d7821c84e46e1fc37c7669dfce8136a7.zip
Merge Henrik Nordströms smartcard branch
Merge from commit 580da6270df61b973fd9ae8cd9aef046bb7e562d of http://github.com/hno/fribid.git
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure71
1 files changed, 54 insertions, 17 deletions
diff --git a/configure b/configure
index 97abf4b..00d9e5a 100755
--- a/configure
+++ b/configure
@@ -25,15 +25,23 @@ prefixSet=""
prefix="/usr/local"
execprefix=""
+if [ -f /usr/lib64/libc.so ]; then
+ multilib="lib64"
+else
+ multilib="lib"
+fi
+
libdir=""
datadir=""
pluginPathSet=""
-pluginPaths="/usr/lib/mozilla/plugins"
+pluginPaths="/usr/$multilib/mozilla/plugins"
userPluginPath="$HOME/.mozilla/plugins"
userPrefix="$HOME/.local"
+pkcs11Engine="/usr/$multilib/opensc-pkcs11.so"
+
error=""
basedir=`dirname "$0"`
@@ -46,7 +54,7 @@ while [ "$#" != "0" ]; do
echo "Usage: $0 [options]
This script creates a build configuration. The default options are to
-install system-wide, into /usr/local, and use /usr/lib/mozilla/plugins
+install system-wide, into /usr/local, and use /usr/$multilib/mozilla/plugins
as the plugin directory.
Options:
@@ -55,12 +63,15 @@ Options:
--prefix=PATH Sets the installation prefix. [/usr/local]
--exec-prefix=PATH Sets the installation prefix for executable files.
The default is to use the same prefix for all files.
- --libdir=PATH Sets the directory for libraries. [EPREFIX/lib]
+ --libdir=PATH Sets the directory for libraries. [EPREFIX/$multilib]
--datadir=PATH Sets the directory for architecture-independent
data. [PREFIX/share]
- --plugin-path=PATH Sets the NPAPI plugin path [/usr/lib/mozilla/plugin]
+ --plugin-path=PATH Sets the NPAPI plugin path [/usr/$multilib/mozilla/plugin]
This option may be repeated if you want to create
plugin links in several places.
+ --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]
--current-user Selects a per-user installation. Equivalent to:
--prefix=$userPrefix
--plugin-path=$userPluginPath
@@ -90,6 +101,15 @@ Options:
pluginPaths="$pluginPaths $path"
fi
;;
+ --pkcs11-engine=*)
+ pkcs11Engine=${flag#--pkcs11-engine=}
+ ;;
+ --disable-pkcs11)
+ enable_pkcs11="0"
+ ;;
+ --enable-pkcs11)
+ enable_pkcs11="1"
+ ;;
--current-user)
if [ -z "$prefixSet" ]; then
prefix="$userPrefix"
@@ -147,7 +167,7 @@ fi
### Specific directories
if [ -z "$libdir" ]; then
- libdir="$execPath/lib"
+ libdir="$execPath/$multilib"
fi
if [ -z "$datadir" ]; then
@@ -160,13 +180,13 @@ hasPaths=""
for path in $pluginPaths; do
hasPaths="1"
if [ "$path" = "${path%/plugins}" ]; then
- echo "WARNING: Plugin path $path doesn't end with /plugins." >&2
+ echo "WARNING: Plugin path $path doesn't end with /plugins." >&2
elif [ -d "$path" ]; then
echo "Plugin path: $path"
else
- echo "WARNING: Plugin path $path doesn't exist!"
- if [ -z "$pluginPathSet" ]; then
- echo " You may need to change it with the --plugin-path=... option." >&2
+ echo "WARNING: Plugin path $path doesn't exist!"
+ if [ -z "$pluginPathSet" ]; then
+ echo "You may need to change it with the --plugin-path=... option." >&2
fi
fi
done
@@ -189,10 +209,23 @@ if ! type $utilities > /dev/null 2> /dev/null; then
done
fi
+if [ -z "$enable_pkcs11" ] && pkg-config --exists libp11; then
+ enable_pkcs11=1
+fi
+
oldifs=IFS
IFS=";"
pkgconfigDeps="gtk+-2.0 >= 2.12;gdk-2.0;glib-2.0;openssl;x11"
-
+if [ "$enable_pkcs11" = 1 ]; then
+ echo "pkcs11 smartcard support enabled"
+ pkgconfigDeps="$pkgconfigDeps;libp11"
+ if [ ! -f $pkcs11Engine ]; then
+ echo "Error: $pkcs11Engine not found"
+ depError=1
+ fi
+else
+ echo "pkcs11 smartcard support disabled"
+fi
if ! pkg-config --exists $pkgconfigDeps; then
echo "Error: Unsatisfied dependencies: " >&2
for dep in $pkgconfigDeps; do
@@ -200,6 +233,7 @@ if ! pkg-config --exists $pkgconfigDeps; then
done
depError=1
fi
+
IFS=oldifs
if [ -n "$depError" ]; then
@@ -209,19 +243,22 @@ fi
### Write configuration
CONFFILE="$basedir/common/config.h"
-echo "
+cat <<EOT >"$CONFFILE"
/* This file is automatically generated.
Run the configure script to change the configuration. */
-#define PREFIX \"$prefixPath\"
-#define EPREFIX \"$execPath\"
+#define PREFIX "$prefixPath"
+#define EPREFIX "$execPath"
+
+#define LIBDIR "$libdir"
+#define DATADIR "$datadir"
-#define LIBDIR \"$libdir\"
-#define DATADIR \"$datadir\"
+#define NPAPI_PLUGIN_PATHS "$pluginPaths"
-#define NPAPI_PLUGIN_PATHS \"$pluginPaths\"
-" > "$CONFFILE"
+#define DEFAULT_PKCS11_ENGINE "$pkcs11Engine"
+#define ENABLE_PKCS11 ${enable_pkcs11:-0}
+EOT
### Display success message
cancreate() {