File: CompilingInstalling.html

package info (click to toggle)
opensc 0.11.1-2etch2
  • links: PTS
  • area: main
  • in suites: etch
  • size: 7,284 kB
  • ctags: 7,257
  • sloc: ansic: 69,499; sh: 9,480; xml: 4,191; makefile: 346; lex: 92; perl: 25
file content (130 lines) | stat: -rw-r--r-- 6,330 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:html="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>CompilingInstalling - OpenSC - Trac</title><style type="text/css">
           @import url(trac.css);
          </style></head><body><div class="wikipage">
    <div id="searchable"><h1>Compiling and Installing OpenSC</h1>
<p>
This page has all the details on compiling and installing OpenSC.
First some general instructions for Linux (and all unix operating
systems not mentioned), and then the special cases for Solaris,
Mac OS X and Windows.
</p>
<p>
First a small warning: do not use gcc 4.0.1/2, opensc will segfault.
The backtraces we have show some stack corruption, and we haven't been
able to isolate the issue yet. So in the meantime we can only ask you
to use gcc 3.3 or 3.4, they work well, and we are not aware of any
issue. Exception: the apple gcc 4.0 on Mac OS X is fine, so far no
problem reports.
</p>
<p>
To compile OpenSC you need to have installed:
pkg-config, openssl (runtime and development), openct and/or pcsc-lite
(runtime and development), libltdl (runtime and development) and if you want the signer part:
libassuan (runtime and development) and x libraries (runtime and development).
</p>
<p>
OpenSC tries to auto-detect all libraries using the pkg-config system.
Most big software projects like KDE or Gnome use it already for a long
time, so most users will have it installed.
</p>
<p>
Note: if you don't have libassuan installed, the signer won't be built.
Most users and developers neither use nor need it. Also note the configure
script does currently not properly check for x11 libraries and development
files, it simply tries to build the signer if libassuan is found, and possibly
fails, if x11 libs and development files are missing.
</p>
<p>
If you don't have pkg-config installed, and don't want to, you can
use environment variables to tell configure, how to link with some
library:
</p>
<ul><li>OPENCT_CFLAGS and OPENCT_LIBS for OpenCT
</li><li>PCSC_CFLAGS and PCSC_LIBS for PC/SC-Lite
</li><li>OPENSSL_CFLAGS and OPENSSL_LIBS for OpenSSL
</li><li>ASSUAN_CFLAGS and ASSUAN_LIBS for Assuan
</li></ul><p>
But most of the time it is easier to let pkg-config handle the
automatic detection. 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 exmaple:
</p>
<pre class="wiki" xml:space="preserve">export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/opt/mystuff/liv/pkgconfig
</pre><h2>Typical Installation</h2>
<p>
But most users use whatever their linux distributions or other operating
systems provide, and thus don't need any of this. We suggest to install
OpenSC into /usr and to put the configfile into /etc. The default
however would be /usr/local and /usr/local/etcc, so you might want
to change those. We suggest to compile OpenSC like this:
</p>
<pre class="wiki" xml:space="preserve">tar xfvz opensc-a.b.c.tar.gz
cd opensc-a.b.c
./configure --prefix=/usr --sysconfdir=/etc
make
make install
cp etc/opensc.conf /etc/
</pre><h3>PC/SC-Lite</h3>
<p>
Most distributions will include pcsc-lite version 1.2.0.
However if you want to use pinpad readers, at least those
that support the new PC/SC v2 Part 10 standard for pinpad
readers, then you need to have pcsc-lite 1.2.9-beta8 or later.
</p>
<p>
The configure script will tell you about this:
</p>
<pre class="wiki" xml:space="preserve">checking for PCSC_CFLAGS... -I/usr/include/PCSC
checking for PCSC_LIBS... -lpcsclite
checking for reader.h... no
configure: WARNING: reader.h not found, install pcsc-lite 1.2.9-beta8 or later, or use PCSC_CFLAGS=... ./configure
</pre><p>
In this example pcsc-lite was found, but only an older version without
support for the new PCSC v2 part 10 standard. This is fine, except
for suport of modern pinpad readers.
</p>
<h2>Mac OS X</h2>
<p>
Apple did not include pkg-config in Mac OS X, changed the pcsc-lite
header files and includes a version of pcsc-lite that does not
support the new PCSC v2 part 10 pinpad reader standard.
</p>
<p>
To compile OpenSC on Mac OS X we suggest:
</p>
<pre class="wiki" xml:space="preserve">export OPENSSL_CFLAGS="-I/usr/include"
export OPENSSL_LIBS="-L/usr/lib -lcrypto"
tar xfvz opensc-a.b.c.tar.gz
cd opensc-a.b.c
./configure --prefix=/usr --sysconfdir=/etc
make
make install
cp etc/opensc.conf /etc/
</pre><h2>Microsoft Windows</h2>
<ul><li>Download, install and use once  <a class="ext-link" title="http://msdn.microsoft.com/vstudio/express/default.aspx" href="http://msdn.microsoft.com/vstudio/express/default.aspx" shape="rect">Visual Studio Express</a>.
</li><li>Download and install <a class="ext-link" title="http://www.microsoft.com/downloads/details.aspx?FamilyId=A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5&amp;displaylang=en" href="http://www.microsoft.com/downloads/details.aspx?FamilyId=A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5&amp;displaylang=en" shape="rect">Microsoft Platform SDK</a>.
</li></ul><p>
 
To compile OpenSC first unpack the opensc-a.b.c.tar.gz file using 7-Zip,
Winzip or some compatible software. You need to have libltdl3 installed
(runtime and development). We suggest the installer provided by the
GnuWin32 project. You need to edit the file <tt>win32/Make.rules.mak</tt>
and point to the location where you installed LIBLTDL.
</p>
<p>
We recommend to compile OpenSC with OpenSSL support. To do that, you
also need to edit the file <tt>win32/Make.rules.mak</tt> and point
to the OpenSSL location.
</p>
<p>
You need to replace <tt>__FUNCTION__</tt> by <tt>__SCFUNCTION__</tt> in the file \opensc-a.b.b\src\include\opensc\log.h to solve a minor compiling error. If you are using Mircrosoft Visual Sudio .NET development environment, you need to copy three files from Visual Studio .NET, namely afxres.h, winrest.h and afsxres.rx, to \opensc-a.b.b\src\include sub-directory before compiling [Can someone test and verify my finding?]
</p>
<p>
Compiling OpenSC is down with a Visual Studio Command Prompt window and entering the commands:
</p>
<pre class="wiki" xml:space="preserve">cd opensc-a.b.c
nmake /f Makefile.mak
</pre></div>
   </div><div class="footer"><hr></hr><p><a href="index.html">Back to Index</a></p></div></body></html>