The preferred method for using OpenSC on Unix is to use the pre-packaged versions from operating system vendor or distribution (see [[Linux Distributions]], for example). If the version is older than the current version, first try to convince the vendor to upgrade the packaged version, if that’s not a possibility, OpenSC can be easily built from source on any modern Unix.
We suggest to install OpenSC into /usr
and to put the configuration file into /etc/opensc
. The default however would be /usr/local
and /usr/local/etc
, so you might want to change those. We suggest to configure and compile OpenSC like this:
tar xfvz opensc-*.tar.gz
cd opensc-*
./bootstrap
./configure --prefix=/usr --sysconfdir=/etc/opensc
make
sudo make install
- PCSC-Lite (runtime and development)
- OpenSSL (optional, runtime and development)
- OpenPACE (optional, runtime and development)
- GNU Readline (optional, runtime and development)
sudo apt-get install pcscd libccid libpcsclite-dev libssl-dev libreadline-dev autoconf automake build-essential docbook-xsl xsltproc libtool pkg-config
If the certificates in the card are compressed, you also need zlib:
sudo apt-get install zlib1g-dev
su -c 'yum install readline-devel openssl-devel libxslt docbook-style-xsl pcsc-lite-devel automake autoconf libtool gcc'
If the certificates in the card are compressed, you also need zlib:
su -c 'yum install zlib-devel'
OpenSC tries to auto-detect all libraries using the pkg-config system.
If you don’t have pkg-config
installed, and don’t want to install it, you can use environment variables to tell configure, how to link with some library:
PCSC_CFLAGS
andPCSC_LIBS
for PCSC-LiteOPENSSL_CFLAGS
andOPENSSL_LIBS
for OpenSSLOPENPACE_CFLAGS
andOPENPACE_LIBS
for OpenPACEREADLINE_CFLAGS
andREADLINE_LIBS
for GNU Readline
./configure --help
will list other useful environment variables.
If some libraries are not installed in typical locations, you need to tell pkg-config
where to find the *.pc
files. You can do this with the PKG_CONFIG_PATH
environment variable, for example:
export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/opt/mystuff/liv/pkgconfig
By default, we are compiling OpenSC with -Wall -Wextra -Wno-unused-parameter -Werror
, which causes all compiler warnings to be treated as errors. Use ./configure --disable-strict
to disable this behavior.