Installing OpenVPN-2.3.8 with non-standard library/header file locations: Occasionally, a user or developer may want to build OpenVPN using source tarballs like LZO (real-time compression library), OpenSSL (needed for encryption) (0.9.8 or higher, 1.0.2d is the latest version as of this writing), PolarSSL (alternative encryption library, version 1.1 or higher), LibPAM, or PKCS, etc. The source code for LZO real-time compression library can be found at: http://www.oberhumer.com/opensource/lzo/ The source code for the OpenSSL encryption library can be found at: http://www.openssl.org The source code for the PolarSSL encryption library can be found at: https://polarssl.org/ Below are some variables which can be added to the './configure' line to let GCC know where to find various header files and/or library files. Variables with _CFLAGS typically take the following form: nnn_CFLAGS="-I" Note the '-I' before the Variables with _LIBS typically take the following form: nnn_LIBS="-L Note the '-L' before the also make sure to tell OpenVPN where to 'look' for the libraries with -lssl and -lcrypto flags on your _LIBS options. As an example, here is what the options would look for using OpenSSL built from source tarball (which installs in /usr/local/ssl) and using LZO built from source tarball: ./configure LZO_CFLAGS="-I/usr/local/include/lzo" \ LZO_LIS="--L/usr/local/lib" \ OPENSSL_SSL_CFLAGS="-I/usr/local/ssl/include/openssl" \ OPENSSL_SSL_LIBS="-L/usr/local/ssl/lib -lssl" \ OPENSSL_CRYPTO_LIBS="-L/usr/local/ssl/lib -lcrypto" \ OPENSSL_CRYPTO_CFLAGS="-I/usr/local/ssl/include/openssl" \ Note: the above could also be entered on a single line with a space between each option. The CFLAGS option 'LZO_CFLAGS' specifies where the LZO header/include files can be found by GCC, and the LIBS option 'LZO_LIBS' specifies where the LZO library files can be found by GCC. The above example is from a default install of LZO-2.0.9 using the following build for LZO: ./configure; make; make check; make test; make install As you can see, the CFLAGS option 'OPENSSL_SSL_CFLAGS/OPENSSL_CRYPTO_CFLAGS' gives the full path where GCC can find the source header/include files for OpenSSL and the LIBS option 'OPENSSL_SSL_LIBS/OPENSSL_CRYPTO_LIBS' gives the full path where GCC can find the library files for OpenSSL. The above example is from a default install of OpenSSL-1.0.2d using the following build for OpenSSL: ./config; make; make test; make install This also assumes you unpacked the source tarball(s) in /usr/local/src, and you have the following layout below (your operating system may have a different layout): drwxr-xr-x. 2 root root 4096 Aug 3 19:57 bin drwxr-xr-x. 2 root root 4096 Aug 16 2014 etc drwxr-xr-x. 2 root root 4096 Aug 16 2014 games drwxr-xr-x. 5 root root 4096 Aug 4 15:01 include drwxr-xr-x. 7 root root 4096 Aug 4 15:01 lib drwxr-xr-x. 4 root root 4096 Aug 3 19:57 lib64 drwxr-xr-x. 2 root root 4096 Aug 16 2014 libexec drwxr-xr-x. 6 root root 4096 Aug 3 19:57 openssl drwxr-xr-x. 2 root root 4096 Aug 16 2014 sbin drwxr-xr-x. 6 root root 4096 Jul 31 19:25 share drwxr-xr-x. 42 root root 4096 Aug 4 14:56 src drwxr-xr-x. 9 root root 4096 Aug 4 14:03 ssl Here is a sample of various flags below can be added to the ./configure line as additional options: LZO_LIBS LZO_CFLAGS POLARSSL_LIBS POLARSSL_CFLAGS OPENSSL_SSL_LIBS OPENSSL_SSL_CFLAGS OPENSSL_CRYPTO_LIBS OPENSSL_CRYPTO_CFLAGS PKCS11_HELPER_LIBS PKCS11_HELPER_CFLAGS LIBPAM_LIBS LIBPAM_CFLAGS Here is an example if PAM/LibPam is build from source and the header files are installed in /usr/local/pam/include and the library files are installed in /usr/local/pam/lib: ./configure LIBPAM_CFLAGS="-I/usr/local/pam/include" LIBPAM_LIBS="-L/usr/local/pam/lib" If the PAM library files were stored in '/usr/local/lib', and the header files were stored in '/usr/local/include', the 'configure' line would look like this: ./configure LIBPAM_CFLAGS="-I/usr/local/include" LIBPAM_LIBS="-L/usr/local/lib"