Ticket #590: INSTALL-nonstandard.txt

File INSTALL-nonstandard.txt, 4.8 KB (added by dogbert2, 7 years ago)

New INSTALL document for OpenVPN 2.3.8

Line 
1Installing OpenVPN-2.3.8 with non-standard library/header file locations:
2
3Occasionally, a user or developer may want to build OpenVPN using
4source tarballs like LZO (real-time compression library), OpenSSL
5(needed for encryption) (0.9.8 or higher, 1.0.2d is the latest
6version as of this writing), PolarSSL (alternative encryption
7library, version 1.1 or higher), LibPAM, or PKCS, etc.
8
9The source code for LZO real-time compression library can be found at:
10
11http://www.oberhumer.com/opensource/lzo/
12
13The source code for the OpenSSL encryption library can be found at:
14
15http://www.openssl.org
16
17The source code for the PolarSSL encryption library can be found at:
18
19https://polarssl.org/
20
21Below are some variables which can be added to the './configure' line
22to let GCC know where to find various header files and/or library files.
23
24Variables with _CFLAGS typically take the following form:
25
26nnn_CFLAGS="-I<path to include files>"
27
28Note the '-I' before the <path to include files>
29
30Variables with _LIBS typically take the following form:
31
32nnn_LIBS="-L<path to library (static or shared) files>
33
34Note the '-L' before the <path to library (static or shared) files>
35
36also make sure to tell OpenVPN where to 'look' for the libraries
37with -lssl and -lcrypto flags on your _LIBS options.
38
39As an example, here is what the options would look for using OpenSSL
40built from source tarball (which installs in /usr/local/ssl) and using
41LZO built from source tarball:
42
43./configure LZO_CFLAGS="-I/usr/local/include/lzo" \
44                    LZO_LIS="--L/usr/local/lib" \
45                        OPENSSL_SSL_CFLAGS="-I/usr/local/ssl/include/openssl" \
46                        OPENSSL_SSL_LIBS="-L/usr/local/ssl/lib -lssl" \
47                        OPENSSL_CRYPTO_LIBS="-L/usr/local/ssl/lib -lcrypto" \
48                        OPENSSL_CRYPTO_CFLAGS="-I/usr/local/ssl/include/openssl" \
49
50Note: the above could also be entered on a single line with a space
51between each option.
52
53The CFLAGS option 'LZO_CFLAGS' specifies where the LZO header/include
54files can be found by GCC, and the LIBS option 'LZO_LIBS' specifies
55where the LZO library files can be found by GCC.
56
57The above example is from a default install of LZO-2.0.9 using the
58following build for LZO:
59
60./configure; make; make check; make test; make install
61
62As you can see, the CFLAGS option 'OPENSSL_SSL_CFLAGS/OPENSSL_CRYPTO_CFLAGS'
63gives the full path where GCC can find the source header/include files for
64OpenSSL and the LIBS option 'OPENSSL_SSL_LIBS/OPENSSL_CRYPTO_LIBS' gives
65the full path where GCC can find the library files for OpenSSL.
66
67The above example is from a default install of OpenSSL-1.0.2d using the
68following build for OpenSSL:
69
70./config; make; make test; make install
71
72This also assumes you unpacked the source tarball(s) in
73/usr/local/src, and you have the following layout below
74(your operating system may have a different layout):
75
76drwxr-xr-x.  2 root root 4096 Aug  3 19:57 bin
77drwxr-xr-x.  2 root root 4096 Aug 16  2014 etc
78drwxr-xr-x.  2 root root 4096 Aug 16  2014 games
79drwxr-xr-x.  5 root root 4096 Aug  4 15:01 include
80drwxr-xr-x.  7 root root 4096 Aug  4 15:01 lib
81drwxr-xr-x.  4 root root 4096 Aug  3 19:57 lib64
82drwxr-xr-x.  2 root root 4096 Aug 16  2014 libexec
83drwxr-xr-x.  6 root root 4096 Aug  3 19:57 openssl
84drwxr-xr-x.  2 root root 4096 Aug 16  2014 sbin
85drwxr-xr-x.  6 root root 4096 Jul 31 19:25 share
86drwxr-xr-x. 42 root root 4096 Aug  4 14:56 src
87drwxr-xr-x.  9 root root 4096 Aug  4 14:03 ssl
88
89Here is a sample of various flags below can be added
90to the ./configure line as additional options:
91
92LZO_LIBS                                <full path to LZO static/shared library files>
93LZO_CFLAGS                              <full path to LZO include/header files>
94POLARSSL_LIBS                   <full path to PolarSSL static/shared library files>
95POLARSSL_CFLAGS                 <full path to PolarSSL include/header files>
96OPENSSL_SSL_LIBS                <full path to OpenSSL SSL static/shared library files>
97OPENSSL_SSL_CFLAGS              <full path to OpenSSL SSL include/header files>
98OPENSSL_CRYPTO_LIBS             <full path to OpenSSL Crypto static/shared library files>
99OPENSSL_CRYPTO_CFLAGS   <full path to OpenSSL Crypto include/header files>
100PKCS11_HELPER_LIBS              <full path to PKCS11 Helper static/shared library files>
101PKCS11_HELPER_CFLAGS    <full path to PKCS11 Helper include/header files>
102LIBPAM_LIBS                             <full path to PAM static/shared library files>
103LIBPAM_CFLAGS                   <full path to PAM library include/header files>
104
105Here is an example if PAM/LibPam is build from source and the header files
106are installed in /usr/local/pam/include and the library files are installed
107in /usr/local/pam/lib:
108
109./configure LIBPAM_CFLAGS="-I/usr/local/pam/include" LIBPAM_LIBS="-L/usr/local/pam/lib"
110
111If the PAM library files were stored in '/usr/local/lib', and the header files were
112stored in '/usr/local/include', the 'configure' line would look like this:
113
114./configure LIBPAM_CFLAGS="-I/usr/local/include" LIBPAM_LIBS="-L/usr/local/lib"
115