<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openssl.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Lmcnerney</id>
	<title>OpenSSLWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openssl.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Lmcnerney"/>
	<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php/Special:Contributions/Lmcnerney"/>
	<updated>2026-04-10T04:26:29Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.13</generator>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=Compilation_and_Installation&amp;diff=2900</id>
		<title>Compilation and Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=Compilation_and_Installation&amp;diff=2900"/>
		<updated>2020-01-16T19:43:14Z</updated>

		<summary type="html">&lt;p&gt;Lmcnerney: /* Windows */ modifieded verbiage for clarity.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following page is a combination of the &amp;lt;tt&amp;gt;INSTALL&amp;lt;/tt&amp;gt; file provided with the OpenSSL library and notes from the field. If you have questions about what you are doing or seeing, then you should consult &amp;lt;tt&amp;gt;INSTALL&amp;lt;/tt&amp;gt; since it contains the commands and specifies the behavior by the development team.&lt;br /&gt;
&lt;br /&gt;
OpenSSL uses a custom build system to configure the library. Configuration will allow the library to set up the recursive makefiles from &amp;lt;tt&amp;gt;makefile.org&amp;lt;/tt&amp;gt;. Once configured, you use &amp;lt;tt&amp;gt;make&amp;lt;/tt&amp;gt; to build the library. You should avoid custom build systems because they often miss details, like each architecture and platform has a unique &amp;lt;tt&amp;gt;opensslconf.h&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;bn.h&amp;lt;/tt&amp;gt; generated by &amp;lt;tt&amp;gt;Configure&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
You must use a C compiler to build the OpenSSL library. You cannot use a C++ compiler. Later, once the library is built, it is OK to create user programs with a C++ compiler. But the library proper must be built with a C compiler.&lt;br /&gt;
&lt;br /&gt;
There are two generations of build system. First is the build system used in OpenSSL 1.0.2 and below. The instructions below apply to it. Second is the build system for OpenSSL 1.1.0 and above. The instructions are similar, but not the same. For example, the second generation abandons the monolithic &amp;lt;tt&amp;gt;Configure&amp;lt;/tt&amp;gt; and places individual configurations in the &amp;lt;tt&amp;gt;Configurations&amp;lt;/tt&amp;gt; directory.  Also, the second generation is more platform agnostic and uses templates to produce a final, top level build file (&amp;lt;tt&amp;gt;Makefile&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;descrip.mms&amp;lt;/tt&amp;gt;, what have you).&lt;br /&gt;
&lt;br /&gt;
After you configure and build the library, you should always perform a &amp;lt;tt&amp;gt;make test&amp;lt;/tt&amp;gt; to ensure the library performs as expected under its self tests. If you are building OpenSSL 1.1.0 and above, then you will also need PERL 5.10 or higher (see &amp;lt;tt&amp;gt;README.PERL&amp;lt;/tt&amp;gt; for details).&lt;br /&gt;
&lt;br /&gt;
OpenSSL's build system does not rely upon &amp;lt;tt&amp;gt;autotools&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;libtool&amp;lt;/tt&amp;gt;. Also see [http://www.openssl.org/support/faq.html#MISC5 Why aren't tools like 'autoconf' and 'libtool' used?] in the OpenSSL FAQ.&lt;br /&gt;
&lt;br /&gt;
== Retrieve source code ==&lt;br /&gt;
&lt;br /&gt;
The OpenSSL source code can be downloaded from [http://www.openssl.org/source/ OpenSSL Source Tarballs] or any suitable [http://www.openssl.org/source/mirror.html ftp mirror]. There are various versions including stable as well as unstable versions. &lt;br /&gt;
&lt;br /&gt;
The source code is managed via Git. Its referred to as Master. The repository is&lt;br /&gt;
&lt;br /&gt;
: git://git.openssl.org/openssl.git&lt;br /&gt;
&lt;br /&gt;
The source is also available via a [https://github.com/openssl/openssl GitHub] mirror. This repository is updated every 15 minutes.&lt;br /&gt;
&lt;br /&gt;
* [[Use_of_Git|Accessing OpenSSL source code via Git]]&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
OpenSSL is configured for a particular platform with protocol and behavior options using &amp;lt;tt&amp;gt;Configure&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;config&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
You should avoid custom build systems because they often miss details, like each architecture and platform has a unique &amp;lt;tt&amp;gt;opensslconf.h&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;bn.h&amp;lt;/tt&amp;gt; generated by &amp;lt;tt&amp;gt;Configure&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Supported Platforms ===&lt;br /&gt;
&lt;br /&gt;
You can run &amp;lt;tt&amp;gt;Configure LIST&amp;lt;/tt&amp;gt; to see a list of available platforms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ ./Configure LIST&lt;br /&gt;
BC-32&lt;br /&gt;
BS2000-OSD&lt;br /&gt;
BSD-generic32&lt;br /&gt;
BSD-generic64&lt;br /&gt;
BSD-ia64&lt;br /&gt;
BSD-sparc64&lt;br /&gt;
BSD-sparcv8&lt;br /&gt;
BSD-x86&lt;br /&gt;
BSD-x86-elf&lt;br /&gt;
BSD-x86_64&lt;br /&gt;
Cygwin&lt;br /&gt;
Cygwin-x86_64&lt;br /&gt;
DJGPP&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your platform is not listed, then use a similar platform and tune the &amp;lt;tt&amp;gt;$cflags&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;$ldflags&amp;lt;/tt&amp;gt; by making a copy of the configure line and giving it its own name. &amp;lt;tt&amp;gt;$cflags&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;$ldflags&amp;lt;/tt&amp;gt; correspond to fields 2 and 6 in a configure line. An example of using a similar configure line is presented in [[Compilation_and_Installation#Using_RPATHs|Using RPATHs]].&lt;br /&gt;
&lt;br /&gt;
=== Configure &amp;amp; Config ===&lt;br /&gt;
&lt;br /&gt;
You use &amp;lt;tt&amp;gt;Configure&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;config&amp;lt;/tt&amp;gt; to tune the compile and installation process through options and switches. The difference between is &amp;lt;tt&amp;gt;Configure&amp;lt;/tt&amp;gt; properly handles the host-arch-compiler triplet, and &amp;lt;tt&amp;gt;config&amp;lt;/tt&amp;gt; does not. &amp;lt;tt&amp;gt;config&amp;lt;/tt&amp;gt; attempts to guess the triplet, so its a lot like autotool's &amp;lt;tt&amp;gt;config.guess&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
You can usually use &amp;lt;tt&amp;gt;config&amp;lt;/tt&amp;gt; and it will do the right thing (from Ubuntu 13.04, x64):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ ./config &lt;br /&gt;
Operating system: x86_64-whatever-linux2&lt;br /&gt;
Configuring for linux-x86_64&lt;br /&gt;
Configuring for linux-x86_64&lt;br /&gt;
    no-ec_nistp_64_gcc_128 [default]  OPENSSL_NO_EC_NISTP_64_GCC_128 (skip dir)&lt;br /&gt;
    no-gmp          [default]  OPENSSL_NO_GMP (skip dir)&lt;br /&gt;
    no-jpake        [experimental] OPENSSL_NO_JPAKE (skip dir)&lt;br /&gt;
    no-krb5         [krb5-flavor not specified] OPENSSL_NO_KRB5&lt;br /&gt;
    ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mac OS X can have issues (its often a neglected platform), and you will have to use &amp;lt;tt&amp;gt;Configure&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; ./Configure darwin64-x86_64-cc&lt;br /&gt;
Configuring for darwin64-x86_64-cc&lt;br /&gt;
    no-ec_nistp_64_gcc_128 [default]  OPENSSL_NO_EC_NISTP_64_GCC_128 (skip dir)&lt;br /&gt;
    no-gmp          [default]  OPENSSL_NO_GMP (skip dir)&lt;br /&gt;
    no-jpake        [experimental] OPENSSL_NO_JPAKE (skip dir)&lt;br /&gt;
    no-krb5         [krb5-flavor not specified] OPENSSL_NO_KRB5&lt;br /&gt;
    ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also configure on Darwin by exporting &amp;lt;tt&amp;gt;KERNEL_BITS&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ export KERNEL_BITS=64&lt;br /&gt;
$ ./config shared no-ssl2 no-ssl3 enable-ec_nistp_64_gcc_128 --openssldir=/usr/local/ssl/macosx-x64/&lt;br /&gt;
Operating system: i686-apple-darwinDarwin Kernel Version 12.5.0: Sun Sep 29 13:33:47 PDT 2013; root:xnu-2050.48.12~1/RELEASE_X86_64&lt;br /&gt;
Configuring for darwin64-x86_64-cc&lt;br /&gt;
Configuring for darwin64-x86_64-cc&lt;br /&gt;
    no-gmp          [default]  OPENSSL_NO_GMP (skip dir)&lt;br /&gt;
    no-jpake        [experimental] OPENSSL_NO_JPAKE (skip dir)&lt;br /&gt;
    no-krb5         [krb5-flavor not specified] OPENSSL_NO_KRB5&lt;br /&gt;
    ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you provide a option not known to configure or ask for help, then you get a brief help message:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ ./Configure --help&lt;br /&gt;
Usage: Configure [no-&amp;lt;cipher&amp;gt; ...] [enable-&amp;lt;cipher&amp;gt; ...] [experimental-&amp;lt;cipher&amp;gt; ...]&lt;br /&gt;
[-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared]&lt;br /&gt;
[[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-krb5] [sctp] [386] [--prefix=DIR]&lt;br /&gt;
[--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--test-sanity] os/compiler[:flags]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And if you supply an unknown triplet: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ ./Configure darwin64-x86_64-clang&lt;br /&gt;
Configuring for darwin64-x86_64-clang&lt;br /&gt;
Usage: Configure [no-&amp;lt;cipher&amp;gt; ...] [enable-&amp;lt;cipher&amp;gt; ...] [experimental-&amp;lt;cipher&amp;gt; ...]&lt;br /&gt;
[-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared]&lt;br /&gt;
[[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-krb5] [sctp] [386] [--prefix=DIR]&lt;br /&gt;
[--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--test-sanity] os/compiler[:flags]&lt;br /&gt;
&lt;br /&gt;
pick os/compiler from:&lt;br /&gt;
BC-32 BS2000-OSD BSD-generic32 BSD-generic64 BSD-ia64 BSD-sparc64 BSD-sparcv8 &lt;br /&gt;
BSD-x86 BSD-x86-elf BSD-x86_64 Cygwin Cygwin-pre1.3 DJGPP MPE/iX-gcc OS2-EMX &lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
NOTE: If in doubt, on Unix-ish systems use './config'.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dependencies ===&lt;br /&gt;
&lt;br /&gt;
If you are prompted to run &amp;lt;tt&amp;gt;make depend&amp;lt;/tt&amp;gt;, then you must do so. For OpenSSL 1.0.2 and below, its required to update the standard distribution once configuration options change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Since you've disabled or enabled at least one algorithm, you need to do&lt;br /&gt;
the following before building:&lt;br /&gt;
&lt;br /&gt;
	make depend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 1.1.0 and above performs the dependency step for you, so you should not see the message. However, you should perform a &amp;lt;tt&amp;gt;make clean&amp;lt;/tt&amp;gt; to ensure the list of objects files is accurate after a reconfiguration.&lt;br /&gt;
&lt;br /&gt;
== Configure Options ==&lt;br /&gt;
&lt;br /&gt;
OpenSSL has been around a long time, and it carries around a lot of cruft. For example, from above, SSLv2 is enabled by default. SSLv2 is completely broken, and you should disable it during configuration. You can disable protocols and provide other options through &amp;lt;tt&amp;gt;Configure&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;config&amp;lt;/tt&amp;gt;, and the following lists some of them.&lt;br /&gt;
&lt;br /&gt;
'''Note''': if you specify a non-existent option, then the configure scripts will proceed without warning. For example, if you inadvertently specify '''no-sslv2''' rather than '''no-ssl2 no-ssl3''', the script will configure ''with'' SSLv2 and ''without'' warning for the unknown no-sslv2.&lt;br /&gt;
&lt;br /&gt;
'''Note''': when building a shared object, both the static archive and shared objects are built. You do not need to do anything special to build both when '''shared''' is specified.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ OpenSSL Library Options&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;150px&amp;quot; | Option&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; class=&amp;quot;unsortable&amp;quot; | Description&lt;br /&gt;
|-&lt;br /&gt;
| --prefix=XXX || See [[#PREFIX_and_OPENSSLDIR|PREFIX and OPENSSLDIR]] in the next section (below).&lt;br /&gt;
|-&lt;br /&gt;
| --openssldir=XXX || See [[#PREFIX_and_OPENSSLDIR|PREFIX and OPENSSLDIR]] in the next section (below).&lt;br /&gt;
|-&lt;br /&gt;
| -d || Debug build of the library. Optimizations are disabled (no &amp;lt;tt&amp;gt;-O3&amp;lt;/tt&amp;gt; or similar) and &amp;lt;tt&amp;gt;libefence&amp;lt;/tt&amp;gt; is used (&amp;lt;tt&amp;gt;apt-get install electric-fence&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;yum install electric-fence&amp;lt;/tt&amp;gt;). TODO: Any other features?&lt;br /&gt;
|-&lt;br /&gt;
| shared || Build a shared object in addition to the static archive. You probably need a [[#Using_RPATHs|RPATH]] when enabling &amp;lt;tt&amp;gt;shared&amp;lt;/tt&amp;gt; to ensure &amp;lt;tt&amp;gt;openssl&amp;lt;/tt&amp;gt; uses the correct &amp;lt;tt&amp;gt;libssl&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;libcrypto&amp;lt;/tt&amp;gt; after installation.&lt;br /&gt;
|-&lt;br /&gt;
| enable-ec_nistp_64_gcc_128 || Use on little endian platforms when GCC supports &amp;lt;tt&amp;gt;__uint128_t&amp;lt;/tt&amp;gt;. ECDH is about 2 to 4 times faster. Not enabled by default because &amp;lt;tt&amp;gt;Configure&amp;lt;/tt&amp;gt; can't determine it. Enable it if your compiler defines &amp;lt;tt&amp;gt;__SIZEOF_INT128__&amp;lt;/tt&amp;gt;, the CPU is little endian and it tolerates unaligned data access.&lt;br /&gt;
|-&lt;br /&gt;
| enable-capieng || Enables the Microsoft CAPI engine on Windows platforms. Used to access the Windows Certificate Store. Also see [http://openssl.6102.n7.nabble.com/Using-Windows-certificate-store-through-OpenSSL-td46788.html Using Windows certificate store through OpenSSL] on the OpenSSL developer list.&lt;br /&gt;
|-&lt;br /&gt;
| no-ssl2 || Disables SSLv2. &amp;lt;tt&amp;gt;OPENSSL_NO_SSL2&amp;lt;/tt&amp;gt; will be defined in the OpenSSL headers.&lt;br /&gt;
|-&lt;br /&gt;
| no-ssl3 || Disables SSLv3. &amp;lt;tt&amp;gt;OPENSSL_NO_SSL3&amp;lt;/tt&amp;gt; will be defined in the OpenSSL headers.&lt;br /&gt;
|-&lt;br /&gt;
| no-comp || Disables compression independent of &amp;lt;tt&amp;gt;zlib&amp;lt;/tt&amp;gt;. &amp;lt;tt&amp;gt;OPENSSL_NO_COMP&amp;lt;/tt&amp;gt; will be defined in the OpenSSL headers.&lt;br /&gt;
|-&lt;br /&gt;
| no-idea || Disables IDEA algorithm. Unlike RC5 and MDC2, IDEA is enabled by default&lt;br /&gt;
|-&lt;br /&gt;
| no-asm || Disables assembly language routines (and uses C routines)&lt;br /&gt;
|-&lt;br /&gt;
| no-dtls || Disables DTLS in OpenSSL 1.1.0 and above&lt;br /&gt;
|-&lt;br /&gt;
| no-dtls1 || Disables DTLS in OpenSSL 1.0.2 and below&lt;br /&gt;
|-&lt;br /&gt;
| no-shared || Disables shared objects (only a static library is created)&lt;br /&gt;
|-&lt;br /&gt;
| no-hw || Disables hardware support (useful on mobile devices)&lt;br /&gt;
|-&lt;br /&gt;
| no-engine || Disables hardware support (useful on mobile devices)&lt;br /&gt;
|-&lt;br /&gt;
| no-threads || Disables threading support.&lt;br /&gt;
|-&lt;br /&gt;
| no-dso || Disables the OpenSSL DSO API (the library offers a shared object abstraction layer). If you disable DSO, then you must disable Engines also&lt;br /&gt;
|-&lt;br /&gt;
| no-err || Removes all error function names and error reason text to reduce footprint&lt;br /&gt;
|-&lt;br /&gt;
| no-npn/no-nextprotoneg || Disables Next Protocol Negotiation (NPN). Use &amp;lt;tt&amp;gt;no-nextprotoneg&amp;lt;/tt&amp;gt; for 1.1.0 and above; and &amp;lt;tt&amp;gt;no-npn&amp;lt;/tt&amp;gt; otherwise&lt;br /&gt;
|-&lt;br /&gt;
| no-psk || Disables Preshared Key (PSK). PSK provides mutual authentication independent of trusted authorities, but its rarely offered or used&lt;br /&gt;
|-&lt;br /&gt;
| no-srp || Disables Secure Remote Password (SRP). SRP provides mutual authentication independent of trusted authorities, but its rarely offered or used&lt;br /&gt;
|-&lt;br /&gt;
| no-ec2m || Used when configuring FIPS Capable Library with a FIPS Object Module that only includes prime curves. That is, use this switch if you use &amp;lt;tt&amp;gt;openssl-fips-ecp-2.0.5&amp;lt;/tt&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| no-weak-ssl-ciphers || Disables RC4. Available in OpenSSL 1.1.0 and above.&lt;br /&gt;
|-&lt;br /&gt;
| -DXXX || Defines XXX. For example, &amp;lt;tt&amp;gt;-DOPENSSL_NO_HEARTBEATS&amp;lt;/tt&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| -DPEDANTIC || Defines PEDANTIC. The library will avoid some undefined behavior, like casting an unaligned byte array to a different pointer type. This define should be used if building OpenSSL with undefined behavior sanitizer (&amp;lt;tt&amp;gt;-fsanitize=undefined&amp;lt;/tt&amp;gt;).&lt;br /&gt;
|-&lt;br /&gt;
| -DOPENSSL_USE_IPV6=0 || Disables IPv6. Useful if OpenSSL encounters incorrect or inconsistent platform headers and mistakenly enables IPv6. Must be passed to &amp;lt;tt&amp;gt;Configure&amp;lt;/tt&amp;gt; manually.&lt;br /&gt;
|-&lt;br /&gt;
| -L''something'', -l''something'', -K''something'', -Wl,''something'' || Linker options, will become part of LDFLAGS.&lt;br /&gt;
|-&lt;br /&gt;
| -''anythingelse'', +''anythingelse'' || Compiler options, will become part of CFLAGS.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''''Note''''': on older OSes, like CentOS 5, BSD 5, and Windows XP or Vista, you will need to configure with &amp;lt;tt&amp;gt;no-async&amp;lt;/tt&amp;gt; when building OpenSSL 1.1.0 and above. The configuration system does not detect lack of the Posix feature on the platforms.&lt;br /&gt;
&lt;br /&gt;
'''''Note''''': you can verify compiler support for &amp;lt;tt&amp;gt;__uint128_t&amp;lt;/tt&amp;gt; with the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# gcc -dM -E - &amp;lt;/dev/null | grep __SIZEOF_INT128__  &lt;br /&gt;
#define __SIZEOF_INT128__ 16&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PREFIX and OPENSSLDIR ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;--prefix&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;--openssldir&amp;lt;/tt&amp;gt; control the configuration of installed components. The behavior and interactions of &amp;lt;tt&amp;gt;--prefix&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;--openssldir&amp;lt;/tt&amp;gt; are slightly different between OpenSSL 1.0.2 and below, and OpenSSL 1.1.0 and above.&lt;br /&gt;
&lt;br /&gt;
The '''''rule of thumb''''' to use when you want something that &amp;quot;just works&amp;quot; for all recent versions of OpenSSL, including OpenSSL 1.0.2 and 1.1.0, is:&lt;br /&gt;
&lt;br /&gt;
* specify ''both'' &amp;lt;tt&amp;gt;--prefix&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;--openssldir&amp;lt;/tt&amp;gt;&lt;br /&gt;
* set &amp;lt;tt&amp;gt;--prefix&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;--openssldir&amp;lt;/tt&amp;gt; to the same location&lt;br /&gt;
&lt;br /&gt;
One word of caution is ''avoid'' &amp;lt;tt&amp;gt;--prefix=/usr&amp;lt;/tt&amp;gt; when OpenSSL versions are '''''not''''' [[Binary_Compatibility|binary compatible]]. You will replace the distro's version of OpenSSL with your version of OpenSSL. It will most likely break everything, including the package management system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''OpenSSL 1.0.2 and below'''&lt;br /&gt;
&lt;br /&gt;
It is usually ''not'' necessary to specify &amp;lt;tt&amp;gt;--prefix&amp;lt;/tt&amp;gt;. If &amp;lt;tt&amp;gt;--prefix&amp;lt;/tt&amp;gt; is ''not'' specified, then &amp;lt;tt&amp;gt;--openssldir&amp;lt;/tt&amp;gt; is used. However, specifying ''only'' &amp;lt;tt&amp;gt;--prefix&amp;lt;/tt&amp;gt; may result in broken builds because the 1.0.2 build system attempts to build in a FIPS configuration.&lt;br /&gt;
&lt;br /&gt;
You can ''omit'' If &amp;lt;tt&amp;gt;--prefix&amp;lt;/tt&amp;gt; and use &amp;lt;tt&amp;gt;--openssldir&amp;lt;/tt&amp;gt;. In this case, the paths for &amp;lt;tt&amp;gt;--openssldir&amp;lt;/tt&amp;gt; will be used during configuration. If &amp;lt;tt&amp;gt;--openssldir&amp;lt;/tt&amp;gt; is not specified, the the default &amp;lt;tt&amp;gt;/usr/local/ssl&amp;lt;/tt&amp;gt; is used.&lt;br /&gt;
&lt;br /&gt;
The takeaway is &amp;lt;tt&amp;gt;/usr/local/ssl&amp;lt;/tt&amp;gt; is used by default, and it can be overridden with &amp;lt;tt&amp;gt;--openssldir&amp;lt;/tt&amp;gt;. The rule of thumb applies for path overrides: specify ''both'' &amp;lt;tt&amp;gt;--prefix&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;--openssldir&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''OpenSSL 1.1.0 and above'''&lt;br /&gt;
&lt;br /&gt;
OpenSSL 1.1.0 changed the behavior of install rules. You should specify both &amp;lt;tt&amp;gt;--prefix&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;--openssldir&amp;lt;/tt&amp;gt; to ensure &amp;lt;tt&amp;gt;make install&amp;lt;/tt&amp;gt; works as expected.&lt;br /&gt;
&lt;br /&gt;
The takeaway is &amp;lt;tt&amp;gt;/usr/local/ssl&amp;lt;/tt&amp;gt; is used by default, and it can be overridden with ''both'' &amp;lt;tt&amp;gt;--prefix&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;--openssldir&amp;lt;/tt&amp;gt;. The rule of thumb applies for path overrides: specify ''both'' &amp;lt;tt&amp;gt;--prefix&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;--openssldir&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Debug Configuration ===&lt;br /&gt;
&lt;br /&gt;
From the list above, its possible to quickly configure a &amp;quot;debug&amp;quot; build with &amp;lt;tt&amp;gt;./config -d&amp;lt;/tt&amp;gt;. However, you can often get into a more amicable state ''without'' the [http://en.wikipedia.org/wiki/Electric_Fence Electric Fence] dependency by issuing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ ./config no-asm -g3 -O0 -fno-omit-frame-pointer -fno-inline-functions&lt;br /&gt;
Operating system: x86_64-whatever-linux2&lt;br /&gt;
Configuring for linux-x86_64&lt;br /&gt;
Configuring OpenSSL version 1.1.0-pre5-dev (0x0x10100005L)&lt;br /&gt;
    no-asm          [option]   OPENSSL_NO_ASM&lt;br /&gt;
    ...&lt;br /&gt;
Configuring for linux-x86_64&lt;br /&gt;
IsMK1MF       =no&lt;br /&gt;
CC            =gcc&lt;br /&gt;
CFLAG         =-Wall -O3 -pthread -m64 -DL_ENDIAN  -g3 -O0 -fno-omit-frame-pointer&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Don't be alarmed about both &amp;lt;tt&amp;gt;-O3&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;-O0&amp;lt;/tt&amp;gt;. The last setting ''&amp;quot;sticks&amp;quot;'', and that's the &amp;lt;tt&amp;gt;-O0&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are working in Visual Studio and you can't step into library calls, then see [http://stackoverflow.com/q/38249235 Step into not working, but can force stepping after some asm steps] on Stack Overflow.&lt;br /&gt;
&lt;br /&gt;
=== Modifying Build Settings ===&lt;br /&gt;
&lt;br /&gt;
Sometimes you need to work around OpenSSL's selections for building the library. For example, you might want to use &amp;lt;tt&amp;gt;-Os&amp;lt;/tt&amp;gt; for a mobile device (rather than &amp;lt;tt&amp;gt;-O3&amp;lt;/tt&amp;gt;), or you might want to use the &amp;lt;tt&amp;gt;clang&amp;lt;/tt&amp;gt; compiler (rather than &amp;lt;tt&amp;gt;gcc&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
In case like these, its often easier to modify &amp;lt;tt&amp;gt;Configure&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Makefile.org&amp;lt;/tt&amp;gt; rather than trying to add targets to the configure scripts. Below is a patch that modifies &amp;lt;tt&amp;gt;Configure&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Makefile.org&amp;lt;/tt&amp;gt; for use under the iOS 7.0 SDK (which lacks &amp;lt;tt&amp;gt;gcc&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/&amp;lt;/tt&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
* Modifies &amp;lt;tt&amp;gt;Configure&amp;lt;/tt&amp;gt; to use &amp;lt;tt&amp;gt;clang&amp;lt;/tt&amp;gt;&lt;br /&gt;
* Modifies &amp;lt;tt&amp;gt;Makefile.org&amp;lt;/tt&amp;gt; to use &amp;lt;tt&amp;gt;clang&amp;lt;/tt&amp;gt;&lt;br /&gt;
* Modifies &amp;lt;tt&amp;gt;CFLAG&amp;lt;/tt&amp;gt; to use &amp;lt;tt&amp;gt;-Os&amp;lt;/tt&amp;gt;&lt;br /&gt;
* Modifies &amp;lt;tt&amp;gt;MAKEDEPPROG&amp;lt;/tt&amp;gt; to use &amp;lt;tt&amp;gt;$(CC) -M&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Setting and resetting of &amp;lt;tt&amp;gt;LANG&amp;lt;/tt&amp;gt; is required on Mac OSX to work around a &amp;lt;tt&amp;gt;sed&amp;lt;/tt&amp;gt; bug or limitation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;OLD_LANG=$LANG&lt;br /&gt;
unset LANG&lt;br /&gt;
&lt;br /&gt;
sed -i &amp;quot;&amp;quot; 's|\&amp;quot;iphoneos-cross\&amp;quot;\,\&amp;quot;llvm-gcc\:-O3|\&amp;quot;iphoneos-cross\&amp;quot;\,\&amp;quot;clang\:-Os|g' Configure&lt;br /&gt;
sed -i &amp;quot;&amp;quot; 's/CC= cc/CC= clang/g' Makefile.org&lt;br /&gt;
sed -i &amp;quot;&amp;quot; 's/CFLAG= -O/CFLAG= -Os/g' Makefile.org&lt;br /&gt;
sed -i &amp;quot;&amp;quot; 's/MAKEDEPPROG=makedepend/MAKEDEPPROG=$(CC) -M/g' Makefile.org&lt;br /&gt;
&lt;br /&gt;
export LANG=$OLD_LANG&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After modification, be sure to dclean and configure again so the new settings are picked up:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make dclean&lt;br /&gt;
&lt;br /&gt;
./config&lt;br /&gt;
make depend&lt;br /&gt;
make all&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Using RPATHs ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;RPATH&amp;lt;/tt&amp;gt;'s are supported by default on the BSD platforms, but not others. If you are working on Linux and compatibles, then you have to manually add an RPATH. One of the easiest ways to add a &amp;lt;tt&amp;gt;RPATH&amp;lt;/tt&amp;gt; is to configure with it as shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./config -Wl,-rpath=/usr/local/ssl/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''''Note well''''': you should use a RPATH when building both OpenSSL and your program. If you don't add a RPATH to both, then your program could runtime-link to the wrong version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
You can also add an &amp;lt;tt&amp;gt;RPATH&amp;lt;/tt&amp;gt; by hard coding the &amp;lt;tt&amp;gt;RPATH&amp;lt;/tt&amp;gt; into a configure line. For example, on Debian x86_64 open the file &amp;lt;tt&amp;gt;Configure&amp;lt;/tt&amp;gt; in an editor, copy &amp;lt;tt&amp;gt;linux-x86_64&amp;lt;/tt&amp;gt;, name it &amp;lt;tt&amp;gt;linux-x86_64-rpath&amp;lt;/tt&amp;gt;, and make the following change to add the &amp;lt;tt&amp;gt;-rpath&amp;lt;/tt&amp;gt; option. Notice the addition of &amp;lt;tt&amp;gt;-Wl,-rpath=...&amp;lt;/tt&amp;gt; in two places.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;quot;linux-x86_64-rpath&amp;quot;, &amp;quot;gcc:-m64 -DL_ENDIAN -O3 -Wall -Wl,-rpath=/usr/local/ssl/lib::&lt;br /&gt;
  -D_REENTRANT::-Wl,-rpath=/usr/local/ssl/lib -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:&lt;br /&gt;
  ${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64&amp;quot;,&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Above, fields 2 and 6 were changed. They correspond to &amp;lt;tt&amp;gt;$cflag&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;$ldflag&amp;lt;/tt&amp;gt; in OpenSSL's builds system.&lt;br /&gt;
&lt;br /&gt;
Then, Configure with the new configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ ./Configure linux-x86_64-rpath shared no-ssl2 no-ssl3 no-comp \&lt;br /&gt;
    --openssldir=/usr/local/ssl enable-ec_nistp_64_gcc_128&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, after &amp;lt;tt&amp;gt;make&amp;lt;/tt&amp;gt;, verify the settings stuck:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ readelf -d ./libssl.so | grep -i rpath&lt;br /&gt;
0x000000000000000f (RPATH)              Library rpath: [/usr/local/ssl/lib]&lt;br /&gt;
$ readelf -d ./libcrypto.so | grep -i rpath&lt;br /&gt;
0x000000000000000f (RPATH)              Library rpath: [/usr/local/ssl/lib]&lt;br /&gt;
$ readelf -d ./apps/openssl | grep -i rpath &lt;br /&gt;
0x000000000000000f (RPATH)              Library rpath: [/usr/local/ssl/lib]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you perform &amp;lt;tt&amp;gt;make install&amp;lt;/tt&amp;gt;, then &amp;lt;tt&amp;gt;ldd&amp;lt;/tt&amp;gt; will produce expected results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ ldd /usr/local/ssl/lib/libssl.so&lt;br /&gt;
linux-vdso.so.1 =&amp;gt;  (0x00007ffceff6c000)&lt;br /&gt;
 ibcrypto.so.1.0.0 =&amp;gt; /usr/local/ssl/lib/libcrypto.so.1.0.0 (0x00007ff5eff96000)&lt;br /&gt;
...&lt;br /&gt;
    &lt;br /&gt;
$ ldd /usr/local/ssl/bin/openssl &lt;br /&gt;
linux-vdso.so.1 =&amp;gt;  (0x00007ffc30d3a000)&lt;br /&gt;
libssl.so.1.0.0 =&amp;gt; /usr/local/ssl/lib/libssl.so.1.0.0 (0x00007f9e8372e000)&lt;br /&gt;
libcrypto.so.1.0.0 =&amp;gt; /usr/local/ssl/lib/libcrypto.so.1.0.0 (0x00007f9e832c0000)&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== FIPS Capable Library ===&lt;br /&gt;
&lt;br /&gt;
If you want to use FIPS validated cryptography, you download, build and install the FIPS Object Module (&amp;lt;tt&amp;gt;openssl-fips-2.0.5.tar.gz&amp;lt;/tt&amp;gt;) according to the [https://www.openssl.org/docs/fips/UserGuide-2.0.pdf FIPS User Guide 2.0] and [https://www.openssl.org/docs/fips/SecurityPolicy-2.0.pdf FIPS 140-2 Security Policy]. You then download, build and install the FIPS Capable Library (&amp;lt;tt&amp;gt;openssl-1.0.1e.tar.gz&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
When configuring the FIPS Capable Library, you must use &amp;lt;tt&amp;gt;fips&amp;lt;/tt&amp;gt; as an option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./config fips &amp;lt;other options ...&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are configuring the FIPS Capable Library with only prime curves (&amp;lt;tt&amp;gt;openssl-fips-ecp-2.0.5.tar.gz&amp;lt;/tt&amp;gt;), then you must configure with &amp;lt;tt&amp;gt;no-ec2m&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./config fips no-ec2m &amp;lt;other options ...&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Compile Time Checking ===&lt;br /&gt;
&lt;br /&gt;
If you disable an option during configure, you can check if it's available through &amp;lt;tt&amp;gt;OPENSSL_NO_*&amp;lt;/tt&amp;gt; defines. OpenSSL writes the configure options to &amp;lt;tt&amp;gt;&amp;lt;openssl/opensslconf.h&amp;gt;&amp;lt;/tt&amp;gt;. For example, if you want to know if SSLv3 is available, then you would perform the following in your code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;openssl/opensslconf.h&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
#if !defined(OPENSSL_NO_SSL3)&lt;br /&gt;
  /* SSLv3 is available */&lt;br /&gt;
#endif&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compilation ==&lt;br /&gt;
&lt;br /&gt;
After configuring the library, you should run &amp;lt;tt&amp;gt;make&amp;lt;/tt&amp;gt;. If prompted, there's usually no need to &amp;lt;tt&amp;gt;make depend&amp;lt;/tt&amp;gt; since you are building from a clean download.&lt;br /&gt;
&lt;br /&gt;
==== Quick ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./config &amp;lt;nowiki&amp;gt;&amp;lt;options ...&amp;gt; --openssldir=/usr/local/ssl&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
make&lt;br /&gt;
make test&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Various options can be found examining the &amp;lt;tt&amp;gt;Configure&amp;lt;/tt&amp;gt; file (there is a well commented block at its top). OpenSSL ships with SSLv2, SSLv3 and Compression enabled by default (see &amp;lt;tt&amp;gt;my $disabled&amp;lt;/tt&amp;gt;), so you might want to use &amp;lt;tt&amp;gt;no-ssl2 no-ssl3&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;no-ssl3&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;no-comp&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Platfom specific ==&lt;br /&gt;
&lt;br /&gt;
=== Linux ===&lt;br /&gt;
&lt;br /&gt;
==== Intel ====&lt;br /&gt;
&lt;br /&gt;
==== ARM ====&lt;br /&gt;
&lt;br /&gt;
==== X32 (ILP32) ====&lt;br /&gt;
&lt;br /&gt;
X32 uses the 32-bit data model (ILP32) on x86_64/amd64. To properly configure for X32 under current OpenSSL distributions, you must use &amp;lt;tt&amp;gt;Configure&amp;lt;/tt&amp;gt; and use the x32 triplet:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ./Configure LIST | grep x32&lt;br /&gt;
linux-x32&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ./Configure linux-x32      &lt;br /&gt;
Configuring OpenSSL version 1.1.0-pre6-dev (0x0x10100006L)&lt;br /&gt;
    no-asan         [default]  OPENSSL_NO_ASAN (skip dir)&lt;br /&gt;
    ...&lt;br /&gt;
Configuring for linux-x32&lt;br /&gt;
CC            =gcc&lt;br /&gt;
CFLAG         =-Wall -O3 -pthread -mx32 -DL_ENDIAN &lt;br /&gt;
SHARED_CFLAG  =-fPIC&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If using an amd64-compatible processor and GCC with that supports &amp;lt;tt&amp;gt;__uint128_t&amp;lt;/tt&amp;gt;, then you usually add &amp;lt;tt&amp;gt;enable-ec_nistp_64_gcc_128 &amp;lt;/tt&amp;gt; in addition to your other flags.&lt;br /&gt;
&lt;br /&gt;
=== Windows ===&lt;br /&gt;
3noch wrote a VERY good guide in 2012 [https://web.archive.org/web/20161123004257/http://developer.covenanteyes.com/building-openssl-for-visual-studio// here] (PLEASE NOTE: the guide was written in 2012 and is no longer available at the original location; the link now points to an archived version at the Internet Archive Wayback Machine).&lt;br /&gt;
&lt;br /&gt;
Like he said in his article, make absolutely sure to create separate directories for 32 and 64 bit versions.&lt;br /&gt;
&lt;br /&gt;
==== W32 / Windows NT - Windows 9x ====&lt;br /&gt;
&lt;br /&gt;
type INSTALL.W32&lt;br /&gt;
&lt;br /&gt;
* you need Perl for Win32.  Unless you will build on Cygwin, you will need ActiveState Perl, available from http://www.activestate.com/ActivePerl.&lt;br /&gt;
* one of the following C compilers:&lt;br /&gt;
** Visual C++&lt;br /&gt;
** Borland C&lt;br /&gt;
** GNU C (Cygwin or MinGW)&lt;br /&gt;
* Netwide Assembler, a.k.a. NASM, available from http://nasm.sourceforge.net/ is required if you intend to utilize assembler modules. Note that NASM is now the only supported assembler.&lt;br /&gt;
&lt;br /&gt;
==== W64 ====&lt;br /&gt;
&lt;br /&gt;
Read first the INSTALL.W64 documentation note containing some specific 64bits information.&lt;br /&gt;
See also INSTALL.W32 that still provides additonnal build information common to both the 64 and 32 bit versions.&lt;br /&gt;
&lt;br /&gt;
You may be surprised: the 64bit artefacts are indeed output in the out32* sub-directories and bear names ending *32.dll. Fact is the 64 bit compile target is so far an incremental change over the legacy 32bit windows target. Numerous compile flags are still labelled &amp;quot;32&amp;quot; although those do apply to both 32 and 64bit targets.&lt;br /&gt;
&lt;br /&gt;
The important pre-requisites are to have PERL available (for essential file processing so as to prepare sources and scripts for the target OS) and of course a C compiler like Microsoft Visual Studio for C/C++. Also note the procedure changed at OpenSSL 1.1.0 and is more streamlined. Also see [https://stackoverflow.com/q/39076244/608639 Why there is no ms\do_ms.bat after perl Configure VC-WIN64A] on Stack Overflow.&lt;br /&gt;
&lt;br /&gt;
=== OpenSSL 1.1.0 ===&lt;br /&gt;
&lt;br /&gt;
For OpenSSL 1.1.0 and above perform these steps:&lt;br /&gt;
&lt;br /&gt;
# Ensure you have perl installed on your machine (e.g. ActiveState or Strawberry), and available on your %PATH%&lt;br /&gt;
# Ensure you have NASM installed on your machine, and available on your %PATH%&lt;br /&gt;
# Extract the source files to your folder, here &amp;lt;code&amp;gt;cd c:\myPath\openssl&amp;lt;/code&amp;gt;&lt;br /&gt;
# Launch Visual Studio tool x64 Cross Tools Command prompt&lt;br /&gt;
# Goto your defined folder &amp;lt;code&amp;gt;cd c:\myPath\openssl&amp;lt;/code&amp;gt;&lt;br /&gt;
# Configure for the target OS with &amp;lt;code&amp;gt;perl Configure VC-WIN64A&amp;lt;/code&amp;gt; or other configurations to be found in the INSTALL file (e.g. UNIX targets). &lt;br /&gt;
## For instance: &amp;lt;code&amp;gt;perl Configure VC-WIN64A&amp;lt;/code&amp;gt;.&lt;br /&gt;
# (''Optional'') In case you compiled before on 32 or 64-bits, make sure you run &amp;lt;code&amp;gt;nmake clean&amp;lt;/code&amp;gt; to prevent trouble across 32 and 64-bits which share output folder.&lt;br /&gt;
# Now build with: &amp;lt;code&amp;gt;nmake&amp;lt;/code&amp;gt;&lt;br /&gt;
# Output can be found in the '''root''' of your folder as '''libcrypto-1_1x64.dll''' and '''libssl-1_1-x64.dll''' (with all the build additionals such as .pdb .lik or static .lib). You may check this is true 64bit code using the Visual Studio tool 'dumpbin'. For instance &amp;lt;code&amp;gt;dumpbin  /headers libcrypto-1_1x64.dll | more&amp;lt;/code&amp;gt;, and look at the FILE HEADER section.&lt;br /&gt;
# Test the code using the 'test' make target, by running &amp;lt;code&amp;gt;nmake test&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Reminder, clean your code to prevent issues the next time you compile for a different target. See step 7.&lt;br /&gt;
&lt;br /&gt;
==== Windows CE ====&lt;br /&gt;
'' Not specified ''&lt;br /&gt;
&lt;br /&gt;
=== OpenSSL 1.0.2 ===&lt;br /&gt;
&lt;br /&gt;
For OpenSSL 1.0.2 and earlier the procedure is as follows.&lt;br /&gt;
&lt;br /&gt;
# Ensure you have perl installed on your machine (e.g. ActiveState or Strawberry), and available on your %PATH%&lt;br /&gt;
# Ensure you have NASM installed on your machine, and available on your %PATH%&lt;br /&gt;
# launch a Visual Studio tool x64 Cross Tools Command prompt&lt;br /&gt;
# change to the directory where you have copied openssl sources &amp;lt;code&amp;gt;cd c:\myPath\openssl&amp;lt;/code&amp;gt;&lt;br /&gt;
# configure for the target OS with the command &amp;lt;code&amp;gt;perl Configure VC-WIN64A&amp;lt;/code&amp;gt;. You may also be interested to set more configuration options as documented in the general INSTALL note (for UNIX targets). For instance: &amp;lt;code&amp;gt;perl Configure VC-WIN64A&amp;lt;/code&amp;gt;.&lt;br /&gt;
# prepare the target environment with the command: &amp;lt;code&amp;gt;ms\do_win64a&amp;lt;/code&amp;gt;&lt;br /&gt;
# ensure you start afresh and notably without linkable products from a previous 32bit compile (as 32 and 64 bits compiling still share common directories) with the command: &amp;lt;code&amp;gt;nmake -f ms\ntdll.mak clean&amp;lt;/code&amp;gt; for the DLL target and &amp;lt;code&amp;gt;nmake -f ms\nt.mak clean&amp;lt;/code&amp;gt; for static libraries.&lt;br /&gt;
# build the code with: &amp;lt;code&amp;gt;nmake -f ms\ntdll.mak&amp;lt;/code&amp;gt; (respectively &amp;lt;code&amp;gt;nmake -f ms\nt.mak&amp;lt;/code&amp;gt; )&lt;br /&gt;
# the artefacts will be found in sub directories out32dll and out32dll.dbg (respectively out32 and out32.dbg for static libraries). The libcrypto and ssl libraries are still named libeay32.lib and ssleay32.lib, and associated includes in inc32 ! You may check this is true 64bit code using the Visual Studio tool 'dumpbin'. For instance &amp;lt;code&amp;gt;dumpbin  /headers out32dll/libeay32.lib | more&amp;lt;/code&amp;gt;, and look at the FILE HEADER section.&lt;br /&gt;
# test the code using the various *test.exe programs in out32dll. Use the 'test' make target to run all tests as in &amp;lt;code&amp;gt;nmake -f ms\ntdll.mak test&amp;lt;/code&amp;gt;&lt;br /&gt;
# we recommend that you move/copy needed includes and libraries from the &amp;quot;32&amp;quot; directories under a new explicit directory tree for 64bit applications from where you will import and link your target applications, similar to that explained in INSTALL.W32.&lt;br /&gt;
&lt;br /&gt;
==== Windows CE ====&lt;br /&gt;
&lt;br /&gt;
=== OS X ===&lt;br /&gt;
&lt;br /&gt;
The earlier discussion presented a lot of information (and some of it had OS X information). Here are the TLDR versions to configure, build and install the library.&lt;br /&gt;
&lt;br /&gt;
If configuring for 64-bit OS X, then use a command similar to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./Configure darwin64-x86_64-cc shared enable-ec_nistp_64_gcc_128 no-ssl2 no-ssl3 no-comp --openssldir=/usr/local/ssl/macos-x86_64&lt;br /&gt;
make depend&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If configuring for 32-bit OS X, then use a command similar to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./Configure darwin-i386-cc shared no-ssl2 no-ssl3 no-comp --openssldir=/usr/local/ssl/macosx-i386&lt;br /&gt;
make depend&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to build a multiarch OpenSSL library, then see this answer on Stack Overflow: [http://stackoverflow.com/a/25531033/608639 Build Multiarch OpenSSL on OS X].&lt;br /&gt;
&lt;br /&gt;
=== iOS ===&lt;br /&gt;
&lt;br /&gt;
The following builds OpenSSL for iOS using the iPhoneOS SDK. The configuration avoids the dynamic library the DSO interface and engines.&lt;br /&gt;
&lt;br /&gt;
If you run &amp;lt;tt&amp;gt;make install&amp;lt;/tt&amp;gt;, then the headers will be installed in &amp;lt;tt&amp;gt;/usr/local/openssl-ios/include&amp;lt;/tt&amp;gt; and libraries will be installed in &amp;lt;tt&amp;gt;/usr/local/openssl-ios/lib&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== 32-bit ====&lt;br /&gt;
&lt;br /&gt;
For OpenSSL 1.1.0 and above, a 32-bit iOS cross-compiles uses the &amp;lt;tt&amp;gt;ios-cross&amp;lt;/tt&amp;gt; target, and options similar to &amp;lt;tt&amp;gt;--prefix=/usr/local/openssl-ios&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ export CC=clang;&lt;br /&gt;
$ export CROSS_TOP=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer&lt;br /&gt;
$ export CROSS_SDK=iPhoneOS.sdk&lt;br /&gt;
$ export PATH=&amp;quot;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:$PATH&amp;quot;&lt;br /&gt;
&lt;br /&gt;
$ ./Configure ios-cross no-shared no-dso no-hw no-engine --prefix=/usr/local/openssl-ios&lt;br /&gt;
&lt;br /&gt;
Configuring OpenSSL version 1.1.1-dev (0x10101000L)&lt;br /&gt;
    no-afalgeng     [forced]   OPENSSL_NO_AFALGENG&lt;br /&gt;
    no-asan         [default]  OPENSSL_NO_ASAN&lt;br /&gt;
    no-dso          [option]&lt;br /&gt;
    no-dynamic-engine [forced]&lt;br /&gt;
    ...&lt;br /&gt;
    no-weak-ssl-ciphers [default]  OPENSSL_NO_WEAK_SSL_CIPHERS&lt;br /&gt;
    no-zlib         [default]&lt;br /&gt;
    no-zlib-dynamic [default]&lt;br /&gt;
Configuring for ios-cross&lt;br /&gt;
&lt;br /&gt;
PERL          =perl&lt;br /&gt;
PERLVERSION   =5.16.2 for darwin-thread-multi-2level&lt;br /&gt;
HASHBANGPERL  =/usr/bin/env perl&lt;br /&gt;
CC            =clang&lt;br /&gt;
CFLAG         =-O3 -D_REENTRANT -arch armv7 -mios-version-min=6.0.0 -isysroot $(CROSS_TOP)/SDKs/$(CROSS_SDK) -fno-common&lt;br /&gt;
CXX           =c++&lt;br /&gt;
CXXFLAG       =-O3 -D_REENTRANT -arch armv7 -mios-version-min=6.0.0 -isysroot $(CROSS_TOP)/SDKs/$(CROSS_SDK) -fno-common&lt;br /&gt;
DEFINES       =NDEBUG OPENSSL_THREADS OPENSSL_NO_DYNAMIC_ENGINE OPENSSL_PIC OPENSSL_BN_ASM_MONT OPENSSL_BN_ASM_GF2m SHA1_ASM SHA256_ASM SHA512_ASM AES_ASM BSAES_ASM GHASH_ASM ECP_NISTZ256_ASM POLY1305_ASM&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are working with OpenSSL 1.0.2 or below, then use the &amp;lt;tt&amp;gt;iphoneos-cross&amp;lt;/tt&amp;gt; target.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ export CC=clang;&lt;br /&gt;
$ export CROSS_TOP=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer&lt;br /&gt;
$ export CROSS_SDK=iPhoneOS.sdk&lt;br /&gt;
$ export PATH=&amp;quot;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:$PATH&amp;quot;&lt;br /&gt;
&lt;br /&gt;
$ ./Configure iphoneos-cross no-shared no-dso no-hw no-engine --prefix=/usr/local/openssl-ios&lt;br /&gt;
Configuring for iphoneos-cross&lt;br /&gt;
    no-dso          [option]&lt;br /&gt;
    no-engine       [option]   OPENSSL_NO_ENGINE (skip dir)&lt;br /&gt;
    no-gmp          [default]  OPENSSL_NO_GMP (skip dir)&lt;br /&gt;
    no-hw           [option]   OPENSSL_NO_HW&lt;br /&gt;
    ...&lt;br /&gt;
    no-weak-ssl-ciphers [default]  OPENSSL_NO_WEAK_SSL_CIPHERS (skip dir)&lt;br /&gt;
    no-zlib         [default]&lt;br /&gt;
    no-zlib-dynamic [default]&lt;br /&gt;
IsMK1MF=0&lt;br /&gt;
CC            =clang&lt;br /&gt;
CFLAG         =-DOPENSSL_THREADS -D_REENTRANT -O3 -isysroot $(CROSS_TOP)/SDKs/$(CROSS_SDK) -fomit-frame-pointer -fno-common&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 64-bit ====&lt;br /&gt;
&lt;br /&gt;
For OpenSSL 1.1.0 , a 64-bit iOS cross-compiles uses the &amp;lt;tt&amp;gt;ios64-cross&amp;lt;/tt&amp;gt; target, and &amp;lt;tt&amp;gt;--prefix=/usr/local/openssl-ios64&amp;lt;/tt&amp;gt;. &amp;lt;tt&amp;gt;ios64-cross&amp;lt;/tt&amp;gt;. There is no built-in 64-bit iOS support for OpenSSL 1.0.2 or below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ export CC=clang;&lt;br /&gt;
$ export CROSS_TOP=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer&lt;br /&gt;
$ export CROSS_SDK=iPhoneOS.sdk&lt;br /&gt;
$ export PATH=&amp;quot;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:$PATH&amp;quot;&lt;br /&gt;
&lt;br /&gt;
$ ./Configure ios64-cross no-shared no-dso no-hw no-engine --prefix=/usr/local/openssl-ios64&lt;br /&gt;
&lt;br /&gt;
Configuring OpenSSL version 1.1.1-dev (0x10101000L)&lt;br /&gt;
    no-afalgeng     [forced]   OPENSSL_NO_AFALGENG&lt;br /&gt;
    no-asan         [default]  OPENSSL_NO_ASAN&lt;br /&gt;
    no-dso          [option]&lt;br /&gt;
    no-dynamic-engine [forced]&lt;br /&gt;
    ...&lt;br /&gt;
    no-weak-ssl-ciphers [default]  OPENSSL_NO_WEAK_SSL_CIPHERS&lt;br /&gt;
    no-zlib         [default]&lt;br /&gt;
    no-zlib-dynamic [default]&lt;br /&gt;
Configuring for ios64-cross&lt;br /&gt;
&lt;br /&gt;
PERL          =perl&lt;br /&gt;
PERLVERSION   =5.16.2 for darwin-thread-multi-2level&lt;br /&gt;
HASHBANGPERL  =/usr/bin/env perl&lt;br /&gt;
CC            =clang&lt;br /&gt;
CFLAG         =-O3 -D_REENTRANT -arch arm64 -mios-version-min=7.0.0 -isysroot $(CROSS_TOP)/SDKs/$(CROSS_SDK) -fno-common&lt;br /&gt;
CXX           =c++&lt;br /&gt;
CXXFLAG       =-O3 -D_REENTRANT -arch arm64 -mios-version-min=7.0.0 -isysroot $(CROSS_TOP)/SDKs/$(CROSS_SDK) -fno-common&lt;br /&gt;
DEFINES       =NDEBUG OPENSSL_THREADS OPENSSL_NO_DYNAMIC_ENGINE OPENSSL_PIC OPENSSL_BN_ASM_MONT SHA1_ASM SHA256_ASM SHA512_ASM VPAES_ASM ECP_NISTZ256_ASM POLY1305_ASM&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Android ===&lt;br /&gt;
&lt;br /&gt;
Visit [[Android]] and [[FIPS Library and Android]].&lt;br /&gt;
&lt;br /&gt;
=== More ===&lt;br /&gt;
&lt;br /&gt;
==== VAX/VMS ====&lt;br /&gt;
&lt;br /&gt;
I you wonder what are files ending with .com like test/testca.com those are VAX/VMX scripts.&lt;br /&gt;
This code is still maintained.&lt;br /&gt;
&lt;br /&gt;
==== OS/2 ====&lt;br /&gt;
&lt;br /&gt;
==== NetWare ====&lt;br /&gt;
5.x 6.x&lt;br /&gt;
&lt;br /&gt;
==== HP-UX ====&lt;br /&gt;
[[HP-UX Itanium FIPS and OpenSSL build]]&lt;br /&gt;
&lt;br /&gt;
==Autoconf==&lt;br /&gt;
&lt;br /&gt;
OpenSSL uses its own configuration system, and does not use Autoconf. However, a number of popular projects use both OpenSSL and Autoconf, and it would be useful to detect either &amp;lt;tt&amp;gt;OPENSSL_init_ssl&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;SSL_library_init&amp;lt;/tt&amp;gt; from &amp;lt;tt&amp;gt;libssl&amp;lt;/tt&amp;gt;. To craft a feature test for OpenSSL that recognizes both &amp;lt;tt&amp;gt;OPENSSL_init_ssl&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;SSL_library_init&amp;lt;/tt&amp;gt;, you can use the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;if test &amp;quot;$with_openssl&amp;quot; = yes ; then&lt;br /&gt;
  dnl Order matters!&lt;br /&gt;
  if test &amp;quot;$PORTNAME&amp;quot; != &amp;quot;win32&amp;quot;; then&lt;br /&gt;
     AC_CHECK_LIB(crypto, CRYPTO_new_ex_data, [], [AC_MSG_ERROR([library 'crypto' is required for OpenSSL])])&lt;br /&gt;
     FOUND_SSL_LIB=&amp;quot;no&amp;quot;&lt;br /&gt;
     AC_CHECK_LIB(ssl, OPENSSL_init_ssl, [FOUND_SSL_LIB=&amp;quot;yes&amp;quot;])&lt;br /&gt;
     AC_CHECK_LIB(ssl, SSL_library_init, [FOUND_SSL_LIB=&amp;quot;yes&amp;quot;])&lt;br /&gt;
     AS_IF([test &amp;quot;x$FOUND_SSL_LIB&amp;quot; = xno], [AC_MSG_ERROR([library 'ssl' is required for OpenSSL])])&lt;br /&gt;
  else&lt;br /&gt;
     AC_SEARCH_LIBS(CRYPTO_new_ex_data, eay32 crypto, [], [AC_MSG_ERROR([library 'eay32' or 'crypto' is required for OpenSSL])])&lt;br /&gt;
     FOUND_SSL_LIB=&amp;quot;no&amp;quot;&lt;br /&gt;
     AC_SEARCH_LIBS(OPENSSL_init_ssl, ssleay32 ssl, [FOUND_SSL_LIB=&amp;quot;yes&amp;quot;])&lt;br /&gt;
     AC_SEARCH_LIBS(SSL_library_init, ssleay32 ssl, [FOUND_SSL_LIB=&amp;quot;yes&amp;quot;])&lt;br /&gt;
     AS_IF([test &amp;quot;x$FOUND_SSL_LIB&amp;quot; = xno], [AC_MSG_ERROR([library 'ssleay32' or 'ssl' is required for OpenSSL])])&lt;br /&gt;
  fi&lt;br /&gt;
fi&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many thanks to the Postgres folks for donating part of their &amp;lt;tt&amp;gt;configure.in&amp;lt;/tt&amp;gt;. Also see [http://stackoverflow.com/q/39285733 How to tell Autoconf “require symbol A or B” from LIB?] on Stack Overflow.&lt;br /&gt;
&lt;br /&gt;
[[Category:Shell level]]&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
[[Category:Compilation]]&lt;/div&gt;</summary>
		<author><name>Lmcnerney</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=Compilation_and_Installation&amp;diff=2899</id>
		<title>Compilation and Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=Compilation_and_Installation&amp;diff=2899"/>
		<updated>2020-01-16T19:41:20Z</updated>

		<summary type="html">&lt;p&gt;Lmcnerney: /* Windows */ Updated broken link to archived version of 3noch's guide to building OpenSSL on Windows.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following page is a combination of the &amp;lt;tt&amp;gt;INSTALL&amp;lt;/tt&amp;gt; file provided with the OpenSSL library and notes from the field. If you have questions about what you are doing or seeing, then you should consult &amp;lt;tt&amp;gt;INSTALL&amp;lt;/tt&amp;gt; since it contains the commands and specifies the behavior by the development team.&lt;br /&gt;
&lt;br /&gt;
OpenSSL uses a custom build system to configure the library. Configuration will allow the library to set up the recursive makefiles from &amp;lt;tt&amp;gt;makefile.org&amp;lt;/tt&amp;gt;. Once configured, you use &amp;lt;tt&amp;gt;make&amp;lt;/tt&amp;gt; to build the library. You should avoid custom build systems because they often miss details, like each architecture and platform has a unique &amp;lt;tt&amp;gt;opensslconf.h&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;bn.h&amp;lt;/tt&amp;gt; generated by &amp;lt;tt&amp;gt;Configure&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
You must use a C compiler to build the OpenSSL library. You cannot use a C++ compiler. Later, once the library is built, it is OK to create user programs with a C++ compiler. But the library proper must be built with a C compiler.&lt;br /&gt;
&lt;br /&gt;
There are two generations of build system. First is the build system used in OpenSSL 1.0.2 and below. The instructions below apply to it. Second is the build system for OpenSSL 1.1.0 and above. The instructions are similar, but not the same. For example, the second generation abandons the monolithic &amp;lt;tt&amp;gt;Configure&amp;lt;/tt&amp;gt; and places individual configurations in the &amp;lt;tt&amp;gt;Configurations&amp;lt;/tt&amp;gt; directory.  Also, the second generation is more platform agnostic and uses templates to produce a final, top level build file (&amp;lt;tt&amp;gt;Makefile&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;descrip.mms&amp;lt;/tt&amp;gt;, what have you).&lt;br /&gt;
&lt;br /&gt;
After you configure and build the library, you should always perform a &amp;lt;tt&amp;gt;make test&amp;lt;/tt&amp;gt; to ensure the library performs as expected under its self tests. If you are building OpenSSL 1.1.0 and above, then you will also need PERL 5.10 or higher (see &amp;lt;tt&amp;gt;README.PERL&amp;lt;/tt&amp;gt; for details).&lt;br /&gt;
&lt;br /&gt;
OpenSSL's build system does not rely upon &amp;lt;tt&amp;gt;autotools&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;libtool&amp;lt;/tt&amp;gt;. Also see [http://www.openssl.org/support/faq.html#MISC5 Why aren't tools like 'autoconf' and 'libtool' used?] in the OpenSSL FAQ.&lt;br /&gt;
&lt;br /&gt;
== Retrieve source code ==&lt;br /&gt;
&lt;br /&gt;
The OpenSSL source code can be downloaded from [http://www.openssl.org/source/ OpenSSL Source Tarballs] or any suitable [http://www.openssl.org/source/mirror.html ftp mirror]. There are various versions including stable as well as unstable versions. &lt;br /&gt;
&lt;br /&gt;
The source code is managed via Git. Its referred to as Master. The repository is&lt;br /&gt;
&lt;br /&gt;
: git://git.openssl.org/openssl.git&lt;br /&gt;
&lt;br /&gt;
The source is also available via a [https://github.com/openssl/openssl GitHub] mirror. This repository is updated every 15 minutes.&lt;br /&gt;
&lt;br /&gt;
* [[Use_of_Git|Accessing OpenSSL source code via Git]]&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
OpenSSL is configured for a particular platform with protocol and behavior options using &amp;lt;tt&amp;gt;Configure&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;config&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
You should avoid custom build systems because they often miss details, like each architecture and platform has a unique &amp;lt;tt&amp;gt;opensslconf.h&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;bn.h&amp;lt;/tt&amp;gt; generated by &amp;lt;tt&amp;gt;Configure&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Supported Platforms ===&lt;br /&gt;
&lt;br /&gt;
You can run &amp;lt;tt&amp;gt;Configure LIST&amp;lt;/tt&amp;gt; to see a list of available platforms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ ./Configure LIST&lt;br /&gt;
BC-32&lt;br /&gt;
BS2000-OSD&lt;br /&gt;
BSD-generic32&lt;br /&gt;
BSD-generic64&lt;br /&gt;
BSD-ia64&lt;br /&gt;
BSD-sparc64&lt;br /&gt;
BSD-sparcv8&lt;br /&gt;
BSD-x86&lt;br /&gt;
BSD-x86-elf&lt;br /&gt;
BSD-x86_64&lt;br /&gt;
Cygwin&lt;br /&gt;
Cygwin-x86_64&lt;br /&gt;
DJGPP&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your platform is not listed, then use a similar platform and tune the &amp;lt;tt&amp;gt;$cflags&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;$ldflags&amp;lt;/tt&amp;gt; by making a copy of the configure line and giving it its own name. &amp;lt;tt&amp;gt;$cflags&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;$ldflags&amp;lt;/tt&amp;gt; correspond to fields 2 and 6 in a configure line. An example of using a similar configure line is presented in [[Compilation_and_Installation#Using_RPATHs|Using RPATHs]].&lt;br /&gt;
&lt;br /&gt;
=== Configure &amp;amp; Config ===&lt;br /&gt;
&lt;br /&gt;
You use &amp;lt;tt&amp;gt;Configure&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;config&amp;lt;/tt&amp;gt; to tune the compile and installation process through options and switches. The difference between is &amp;lt;tt&amp;gt;Configure&amp;lt;/tt&amp;gt; properly handles the host-arch-compiler triplet, and &amp;lt;tt&amp;gt;config&amp;lt;/tt&amp;gt; does not. &amp;lt;tt&amp;gt;config&amp;lt;/tt&amp;gt; attempts to guess the triplet, so its a lot like autotool's &amp;lt;tt&amp;gt;config.guess&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
You can usually use &amp;lt;tt&amp;gt;config&amp;lt;/tt&amp;gt; and it will do the right thing (from Ubuntu 13.04, x64):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ ./config &lt;br /&gt;
Operating system: x86_64-whatever-linux2&lt;br /&gt;
Configuring for linux-x86_64&lt;br /&gt;
Configuring for linux-x86_64&lt;br /&gt;
    no-ec_nistp_64_gcc_128 [default]  OPENSSL_NO_EC_NISTP_64_GCC_128 (skip dir)&lt;br /&gt;
    no-gmp          [default]  OPENSSL_NO_GMP (skip dir)&lt;br /&gt;
    no-jpake        [experimental] OPENSSL_NO_JPAKE (skip dir)&lt;br /&gt;
    no-krb5         [krb5-flavor not specified] OPENSSL_NO_KRB5&lt;br /&gt;
    ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mac OS X can have issues (its often a neglected platform), and you will have to use &amp;lt;tt&amp;gt;Configure&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; ./Configure darwin64-x86_64-cc&lt;br /&gt;
Configuring for darwin64-x86_64-cc&lt;br /&gt;
    no-ec_nistp_64_gcc_128 [default]  OPENSSL_NO_EC_NISTP_64_GCC_128 (skip dir)&lt;br /&gt;
    no-gmp          [default]  OPENSSL_NO_GMP (skip dir)&lt;br /&gt;
    no-jpake        [experimental] OPENSSL_NO_JPAKE (skip dir)&lt;br /&gt;
    no-krb5         [krb5-flavor not specified] OPENSSL_NO_KRB5&lt;br /&gt;
    ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also configure on Darwin by exporting &amp;lt;tt&amp;gt;KERNEL_BITS&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ export KERNEL_BITS=64&lt;br /&gt;
$ ./config shared no-ssl2 no-ssl3 enable-ec_nistp_64_gcc_128 --openssldir=/usr/local/ssl/macosx-x64/&lt;br /&gt;
Operating system: i686-apple-darwinDarwin Kernel Version 12.5.0: Sun Sep 29 13:33:47 PDT 2013; root:xnu-2050.48.12~1/RELEASE_X86_64&lt;br /&gt;
Configuring for darwin64-x86_64-cc&lt;br /&gt;
Configuring for darwin64-x86_64-cc&lt;br /&gt;
    no-gmp          [default]  OPENSSL_NO_GMP (skip dir)&lt;br /&gt;
    no-jpake        [experimental] OPENSSL_NO_JPAKE (skip dir)&lt;br /&gt;
    no-krb5         [krb5-flavor not specified] OPENSSL_NO_KRB5&lt;br /&gt;
    ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you provide a option not known to configure or ask for help, then you get a brief help message:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ ./Configure --help&lt;br /&gt;
Usage: Configure [no-&amp;lt;cipher&amp;gt; ...] [enable-&amp;lt;cipher&amp;gt; ...] [experimental-&amp;lt;cipher&amp;gt; ...]&lt;br /&gt;
[-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared]&lt;br /&gt;
[[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-krb5] [sctp] [386] [--prefix=DIR]&lt;br /&gt;
[--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--test-sanity] os/compiler[:flags]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And if you supply an unknown triplet: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ ./Configure darwin64-x86_64-clang&lt;br /&gt;
Configuring for darwin64-x86_64-clang&lt;br /&gt;
Usage: Configure [no-&amp;lt;cipher&amp;gt; ...] [enable-&amp;lt;cipher&amp;gt; ...] [experimental-&amp;lt;cipher&amp;gt; ...]&lt;br /&gt;
[-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared]&lt;br /&gt;
[[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-krb5] [sctp] [386] [--prefix=DIR]&lt;br /&gt;
[--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--test-sanity] os/compiler[:flags]&lt;br /&gt;
&lt;br /&gt;
pick os/compiler from:&lt;br /&gt;
BC-32 BS2000-OSD BSD-generic32 BSD-generic64 BSD-ia64 BSD-sparc64 BSD-sparcv8 &lt;br /&gt;
BSD-x86 BSD-x86-elf BSD-x86_64 Cygwin Cygwin-pre1.3 DJGPP MPE/iX-gcc OS2-EMX &lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
NOTE: If in doubt, on Unix-ish systems use './config'.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dependencies ===&lt;br /&gt;
&lt;br /&gt;
If you are prompted to run &amp;lt;tt&amp;gt;make depend&amp;lt;/tt&amp;gt;, then you must do so. For OpenSSL 1.0.2 and below, its required to update the standard distribution once configuration options change.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Since you've disabled or enabled at least one algorithm, you need to do&lt;br /&gt;
the following before building:&lt;br /&gt;
&lt;br /&gt;
	make depend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenSSL 1.1.0 and above performs the dependency step for you, so you should not see the message. However, you should perform a &amp;lt;tt&amp;gt;make clean&amp;lt;/tt&amp;gt; to ensure the list of objects files is accurate after a reconfiguration.&lt;br /&gt;
&lt;br /&gt;
== Configure Options ==&lt;br /&gt;
&lt;br /&gt;
OpenSSL has been around a long time, and it carries around a lot of cruft. For example, from above, SSLv2 is enabled by default. SSLv2 is completely broken, and you should disable it during configuration. You can disable protocols and provide other options through &amp;lt;tt&amp;gt;Configure&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;config&amp;lt;/tt&amp;gt;, and the following lists some of them.&lt;br /&gt;
&lt;br /&gt;
'''Note''': if you specify a non-existent option, then the configure scripts will proceed without warning. For example, if you inadvertently specify '''no-sslv2''' rather than '''no-ssl2 no-ssl3''', the script will configure ''with'' SSLv2 and ''without'' warning for the unknown no-sslv2.&lt;br /&gt;
&lt;br /&gt;
'''Note''': when building a shared object, both the static archive and shared objects are built. You do not need to do anything special to build both when '''shared''' is specified.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ OpenSSL Library Options&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;150px&amp;quot; | Option&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; class=&amp;quot;unsortable&amp;quot; | Description&lt;br /&gt;
|-&lt;br /&gt;
| --prefix=XXX || See [[#PREFIX_and_OPENSSLDIR|PREFIX and OPENSSLDIR]] in the next section (below).&lt;br /&gt;
|-&lt;br /&gt;
| --openssldir=XXX || See [[#PREFIX_and_OPENSSLDIR|PREFIX and OPENSSLDIR]] in the next section (below).&lt;br /&gt;
|-&lt;br /&gt;
| -d || Debug build of the library. Optimizations are disabled (no &amp;lt;tt&amp;gt;-O3&amp;lt;/tt&amp;gt; or similar) and &amp;lt;tt&amp;gt;libefence&amp;lt;/tt&amp;gt; is used (&amp;lt;tt&amp;gt;apt-get install electric-fence&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;yum install electric-fence&amp;lt;/tt&amp;gt;). TODO: Any other features?&lt;br /&gt;
|-&lt;br /&gt;
| shared || Build a shared object in addition to the static archive. You probably need a [[#Using_RPATHs|RPATH]] when enabling &amp;lt;tt&amp;gt;shared&amp;lt;/tt&amp;gt; to ensure &amp;lt;tt&amp;gt;openssl&amp;lt;/tt&amp;gt; uses the correct &amp;lt;tt&amp;gt;libssl&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;libcrypto&amp;lt;/tt&amp;gt; after installation.&lt;br /&gt;
|-&lt;br /&gt;
| enable-ec_nistp_64_gcc_128 || Use on little endian platforms when GCC supports &amp;lt;tt&amp;gt;__uint128_t&amp;lt;/tt&amp;gt;. ECDH is about 2 to 4 times faster. Not enabled by default because &amp;lt;tt&amp;gt;Configure&amp;lt;/tt&amp;gt; can't determine it. Enable it if your compiler defines &amp;lt;tt&amp;gt;__SIZEOF_INT128__&amp;lt;/tt&amp;gt;, the CPU is little endian and it tolerates unaligned data access.&lt;br /&gt;
|-&lt;br /&gt;
| enable-capieng || Enables the Microsoft CAPI engine on Windows platforms. Used to access the Windows Certificate Store. Also see [http://openssl.6102.n7.nabble.com/Using-Windows-certificate-store-through-OpenSSL-td46788.html Using Windows certificate store through OpenSSL] on the OpenSSL developer list.&lt;br /&gt;
|-&lt;br /&gt;
| no-ssl2 || Disables SSLv2. &amp;lt;tt&amp;gt;OPENSSL_NO_SSL2&amp;lt;/tt&amp;gt; will be defined in the OpenSSL headers.&lt;br /&gt;
|-&lt;br /&gt;
| no-ssl3 || Disables SSLv3. &amp;lt;tt&amp;gt;OPENSSL_NO_SSL3&amp;lt;/tt&amp;gt; will be defined in the OpenSSL headers.&lt;br /&gt;
|-&lt;br /&gt;
| no-comp || Disables compression independent of &amp;lt;tt&amp;gt;zlib&amp;lt;/tt&amp;gt;. &amp;lt;tt&amp;gt;OPENSSL_NO_COMP&amp;lt;/tt&amp;gt; will be defined in the OpenSSL headers.&lt;br /&gt;
|-&lt;br /&gt;
| no-idea || Disables IDEA algorithm. Unlike RC5 and MDC2, IDEA is enabled by default&lt;br /&gt;
|-&lt;br /&gt;
| no-asm || Disables assembly language routines (and uses C routines)&lt;br /&gt;
|-&lt;br /&gt;
| no-dtls || Disables DTLS in OpenSSL 1.1.0 and above&lt;br /&gt;
|-&lt;br /&gt;
| no-dtls1 || Disables DTLS in OpenSSL 1.0.2 and below&lt;br /&gt;
|-&lt;br /&gt;
| no-shared || Disables shared objects (only a static library is created)&lt;br /&gt;
|-&lt;br /&gt;
| no-hw || Disables hardware support (useful on mobile devices)&lt;br /&gt;
|-&lt;br /&gt;
| no-engine || Disables hardware support (useful on mobile devices)&lt;br /&gt;
|-&lt;br /&gt;
| no-threads || Disables threading support.&lt;br /&gt;
|-&lt;br /&gt;
| no-dso || Disables the OpenSSL DSO API (the library offers a shared object abstraction layer). If you disable DSO, then you must disable Engines also&lt;br /&gt;
|-&lt;br /&gt;
| no-err || Removes all error function names and error reason text to reduce footprint&lt;br /&gt;
|-&lt;br /&gt;
| no-npn/no-nextprotoneg || Disables Next Protocol Negotiation (NPN). Use &amp;lt;tt&amp;gt;no-nextprotoneg&amp;lt;/tt&amp;gt; for 1.1.0 and above; and &amp;lt;tt&amp;gt;no-npn&amp;lt;/tt&amp;gt; otherwise&lt;br /&gt;
|-&lt;br /&gt;
| no-psk || Disables Preshared Key (PSK). PSK provides mutual authentication independent of trusted authorities, but its rarely offered or used&lt;br /&gt;
|-&lt;br /&gt;
| no-srp || Disables Secure Remote Password (SRP). SRP provides mutual authentication independent of trusted authorities, but its rarely offered or used&lt;br /&gt;
|-&lt;br /&gt;
| no-ec2m || Used when configuring FIPS Capable Library with a FIPS Object Module that only includes prime curves. That is, use this switch if you use &amp;lt;tt&amp;gt;openssl-fips-ecp-2.0.5&amp;lt;/tt&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| no-weak-ssl-ciphers || Disables RC4. Available in OpenSSL 1.1.0 and above.&lt;br /&gt;
|-&lt;br /&gt;
| -DXXX || Defines XXX. For example, &amp;lt;tt&amp;gt;-DOPENSSL_NO_HEARTBEATS&amp;lt;/tt&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| -DPEDANTIC || Defines PEDANTIC. The library will avoid some undefined behavior, like casting an unaligned byte array to a different pointer type. This define should be used if building OpenSSL with undefined behavior sanitizer (&amp;lt;tt&amp;gt;-fsanitize=undefined&amp;lt;/tt&amp;gt;).&lt;br /&gt;
|-&lt;br /&gt;
| -DOPENSSL_USE_IPV6=0 || Disables IPv6. Useful if OpenSSL encounters incorrect or inconsistent platform headers and mistakenly enables IPv6. Must be passed to &amp;lt;tt&amp;gt;Configure&amp;lt;/tt&amp;gt; manually.&lt;br /&gt;
|-&lt;br /&gt;
| -L''something'', -l''something'', -K''something'', -Wl,''something'' || Linker options, will become part of LDFLAGS.&lt;br /&gt;
|-&lt;br /&gt;
| -''anythingelse'', +''anythingelse'' || Compiler options, will become part of CFLAGS.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''''Note''''': on older OSes, like CentOS 5, BSD 5, and Windows XP or Vista, you will need to configure with &amp;lt;tt&amp;gt;no-async&amp;lt;/tt&amp;gt; when building OpenSSL 1.1.0 and above. The configuration system does not detect lack of the Posix feature on the platforms.&lt;br /&gt;
&lt;br /&gt;
'''''Note''''': you can verify compiler support for &amp;lt;tt&amp;gt;__uint128_t&amp;lt;/tt&amp;gt; with the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# gcc -dM -E - &amp;lt;/dev/null | grep __SIZEOF_INT128__  &lt;br /&gt;
#define __SIZEOF_INT128__ 16&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PREFIX and OPENSSLDIR ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;--prefix&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;--openssldir&amp;lt;/tt&amp;gt; control the configuration of installed components. The behavior and interactions of &amp;lt;tt&amp;gt;--prefix&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;--openssldir&amp;lt;/tt&amp;gt; are slightly different between OpenSSL 1.0.2 and below, and OpenSSL 1.1.0 and above.&lt;br /&gt;
&lt;br /&gt;
The '''''rule of thumb''''' to use when you want something that &amp;quot;just works&amp;quot; for all recent versions of OpenSSL, including OpenSSL 1.0.2 and 1.1.0, is:&lt;br /&gt;
&lt;br /&gt;
* specify ''both'' &amp;lt;tt&amp;gt;--prefix&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;--openssldir&amp;lt;/tt&amp;gt;&lt;br /&gt;
* set &amp;lt;tt&amp;gt;--prefix&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;--openssldir&amp;lt;/tt&amp;gt; to the same location&lt;br /&gt;
&lt;br /&gt;
One word of caution is ''avoid'' &amp;lt;tt&amp;gt;--prefix=/usr&amp;lt;/tt&amp;gt; when OpenSSL versions are '''''not''''' [[Binary_Compatibility|binary compatible]]. You will replace the distro's version of OpenSSL with your version of OpenSSL. It will most likely break everything, including the package management system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''OpenSSL 1.0.2 and below'''&lt;br /&gt;
&lt;br /&gt;
It is usually ''not'' necessary to specify &amp;lt;tt&amp;gt;--prefix&amp;lt;/tt&amp;gt;. If &amp;lt;tt&amp;gt;--prefix&amp;lt;/tt&amp;gt; is ''not'' specified, then &amp;lt;tt&amp;gt;--openssldir&amp;lt;/tt&amp;gt; is used. However, specifying ''only'' &amp;lt;tt&amp;gt;--prefix&amp;lt;/tt&amp;gt; may result in broken builds because the 1.0.2 build system attempts to build in a FIPS configuration.&lt;br /&gt;
&lt;br /&gt;
You can ''omit'' If &amp;lt;tt&amp;gt;--prefix&amp;lt;/tt&amp;gt; and use &amp;lt;tt&amp;gt;--openssldir&amp;lt;/tt&amp;gt;. In this case, the paths for &amp;lt;tt&amp;gt;--openssldir&amp;lt;/tt&amp;gt; will be used during configuration. If &amp;lt;tt&amp;gt;--openssldir&amp;lt;/tt&amp;gt; is not specified, the the default &amp;lt;tt&amp;gt;/usr/local/ssl&amp;lt;/tt&amp;gt; is used.&lt;br /&gt;
&lt;br /&gt;
The takeaway is &amp;lt;tt&amp;gt;/usr/local/ssl&amp;lt;/tt&amp;gt; is used by default, and it can be overridden with &amp;lt;tt&amp;gt;--openssldir&amp;lt;/tt&amp;gt;. The rule of thumb applies for path overrides: specify ''both'' &amp;lt;tt&amp;gt;--prefix&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;--openssldir&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''OpenSSL 1.1.0 and above'''&lt;br /&gt;
&lt;br /&gt;
OpenSSL 1.1.0 changed the behavior of install rules. You should specify both &amp;lt;tt&amp;gt;--prefix&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;--openssldir&amp;lt;/tt&amp;gt; to ensure &amp;lt;tt&amp;gt;make install&amp;lt;/tt&amp;gt; works as expected.&lt;br /&gt;
&lt;br /&gt;
The takeaway is &amp;lt;tt&amp;gt;/usr/local/ssl&amp;lt;/tt&amp;gt; is used by default, and it can be overridden with ''both'' &amp;lt;tt&amp;gt;--prefix&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;--openssldir&amp;lt;/tt&amp;gt;. The rule of thumb applies for path overrides: specify ''both'' &amp;lt;tt&amp;gt;--prefix&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;--openssldir&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Debug Configuration ===&lt;br /&gt;
&lt;br /&gt;
From the list above, its possible to quickly configure a &amp;quot;debug&amp;quot; build with &amp;lt;tt&amp;gt;./config -d&amp;lt;/tt&amp;gt;. However, you can often get into a more amicable state ''without'' the [http://en.wikipedia.org/wiki/Electric_Fence Electric Fence] dependency by issuing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ ./config no-asm -g3 -O0 -fno-omit-frame-pointer -fno-inline-functions&lt;br /&gt;
Operating system: x86_64-whatever-linux2&lt;br /&gt;
Configuring for linux-x86_64&lt;br /&gt;
Configuring OpenSSL version 1.1.0-pre5-dev (0x0x10100005L)&lt;br /&gt;
    no-asm          [option]   OPENSSL_NO_ASM&lt;br /&gt;
    ...&lt;br /&gt;
Configuring for linux-x86_64&lt;br /&gt;
IsMK1MF       =no&lt;br /&gt;
CC            =gcc&lt;br /&gt;
CFLAG         =-Wall -O3 -pthread -m64 -DL_ENDIAN  -g3 -O0 -fno-omit-frame-pointer&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Don't be alarmed about both &amp;lt;tt&amp;gt;-O3&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;-O0&amp;lt;/tt&amp;gt;. The last setting ''&amp;quot;sticks&amp;quot;'', and that's the &amp;lt;tt&amp;gt;-O0&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are working in Visual Studio and you can't step into library calls, then see [http://stackoverflow.com/q/38249235 Step into not working, but can force stepping after some asm steps] on Stack Overflow.&lt;br /&gt;
&lt;br /&gt;
=== Modifying Build Settings ===&lt;br /&gt;
&lt;br /&gt;
Sometimes you need to work around OpenSSL's selections for building the library. For example, you might want to use &amp;lt;tt&amp;gt;-Os&amp;lt;/tt&amp;gt; for a mobile device (rather than &amp;lt;tt&amp;gt;-O3&amp;lt;/tt&amp;gt;), or you might want to use the &amp;lt;tt&amp;gt;clang&amp;lt;/tt&amp;gt; compiler (rather than &amp;lt;tt&amp;gt;gcc&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
In case like these, its often easier to modify &amp;lt;tt&amp;gt;Configure&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Makefile.org&amp;lt;/tt&amp;gt; rather than trying to add targets to the configure scripts. Below is a patch that modifies &amp;lt;tt&amp;gt;Configure&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Makefile.org&amp;lt;/tt&amp;gt; for use under the iOS 7.0 SDK (which lacks &amp;lt;tt&amp;gt;gcc&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/&amp;lt;/tt&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
* Modifies &amp;lt;tt&amp;gt;Configure&amp;lt;/tt&amp;gt; to use &amp;lt;tt&amp;gt;clang&amp;lt;/tt&amp;gt;&lt;br /&gt;
* Modifies &amp;lt;tt&amp;gt;Makefile.org&amp;lt;/tt&amp;gt; to use &amp;lt;tt&amp;gt;clang&amp;lt;/tt&amp;gt;&lt;br /&gt;
* Modifies &amp;lt;tt&amp;gt;CFLAG&amp;lt;/tt&amp;gt; to use &amp;lt;tt&amp;gt;-Os&amp;lt;/tt&amp;gt;&lt;br /&gt;
* Modifies &amp;lt;tt&amp;gt;MAKEDEPPROG&amp;lt;/tt&amp;gt; to use &amp;lt;tt&amp;gt;$(CC) -M&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Setting and resetting of &amp;lt;tt&amp;gt;LANG&amp;lt;/tt&amp;gt; is required on Mac OSX to work around a &amp;lt;tt&amp;gt;sed&amp;lt;/tt&amp;gt; bug or limitation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;OLD_LANG=$LANG&lt;br /&gt;
unset LANG&lt;br /&gt;
&lt;br /&gt;
sed -i &amp;quot;&amp;quot; 's|\&amp;quot;iphoneos-cross\&amp;quot;\,\&amp;quot;llvm-gcc\:-O3|\&amp;quot;iphoneos-cross\&amp;quot;\,\&amp;quot;clang\:-Os|g' Configure&lt;br /&gt;
sed -i &amp;quot;&amp;quot; 's/CC= cc/CC= clang/g' Makefile.org&lt;br /&gt;
sed -i &amp;quot;&amp;quot; 's/CFLAG= -O/CFLAG= -Os/g' Makefile.org&lt;br /&gt;
sed -i &amp;quot;&amp;quot; 's/MAKEDEPPROG=makedepend/MAKEDEPPROG=$(CC) -M/g' Makefile.org&lt;br /&gt;
&lt;br /&gt;
export LANG=$OLD_LANG&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After modification, be sure to dclean and configure again so the new settings are picked up:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;make dclean&lt;br /&gt;
&lt;br /&gt;
./config&lt;br /&gt;
make depend&lt;br /&gt;
make all&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Using RPATHs ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;RPATH&amp;lt;/tt&amp;gt;'s are supported by default on the BSD platforms, but not others. If you are working on Linux and compatibles, then you have to manually add an RPATH. One of the easiest ways to add a &amp;lt;tt&amp;gt;RPATH&amp;lt;/tt&amp;gt; is to configure with it as shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./config -Wl,-rpath=/usr/local/ssl/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''''Note well''''': you should use a RPATH when building both OpenSSL and your program. If you don't add a RPATH to both, then your program could runtime-link to the wrong version of OpenSSL.&lt;br /&gt;
&lt;br /&gt;
You can also add an &amp;lt;tt&amp;gt;RPATH&amp;lt;/tt&amp;gt; by hard coding the &amp;lt;tt&amp;gt;RPATH&amp;lt;/tt&amp;gt; into a configure line. For example, on Debian x86_64 open the file &amp;lt;tt&amp;gt;Configure&amp;lt;/tt&amp;gt; in an editor, copy &amp;lt;tt&amp;gt;linux-x86_64&amp;lt;/tt&amp;gt;, name it &amp;lt;tt&amp;gt;linux-x86_64-rpath&amp;lt;/tt&amp;gt;, and make the following change to add the &amp;lt;tt&amp;gt;-rpath&amp;lt;/tt&amp;gt; option. Notice the addition of &amp;lt;tt&amp;gt;-Wl,-rpath=...&amp;lt;/tt&amp;gt; in two places.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;quot;linux-x86_64-rpath&amp;quot;, &amp;quot;gcc:-m64 -DL_ENDIAN -O3 -Wall -Wl,-rpath=/usr/local/ssl/lib::&lt;br /&gt;
  -D_REENTRANT::-Wl,-rpath=/usr/local/ssl/lib -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:&lt;br /&gt;
  ${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64&amp;quot;,&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Above, fields 2 and 6 were changed. They correspond to &amp;lt;tt&amp;gt;$cflag&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;$ldflag&amp;lt;/tt&amp;gt; in OpenSSL's builds system.&lt;br /&gt;
&lt;br /&gt;
Then, Configure with the new configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ ./Configure linux-x86_64-rpath shared no-ssl2 no-ssl3 no-comp \&lt;br /&gt;
    --openssldir=/usr/local/ssl enable-ec_nistp_64_gcc_128&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, after &amp;lt;tt&amp;gt;make&amp;lt;/tt&amp;gt;, verify the settings stuck:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ readelf -d ./libssl.so | grep -i rpath&lt;br /&gt;
0x000000000000000f (RPATH)              Library rpath: [/usr/local/ssl/lib]&lt;br /&gt;
$ readelf -d ./libcrypto.so | grep -i rpath&lt;br /&gt;
0x000000000000000f (RPATH)              Library rpath: [/usr/local/ssl/lib]&lt;br /&gt;
$ readelf -d ./apps/openssl | grep -i rpath &lt;br /&gt;
0x000000000000000f (RPATH)              Library rpath: [/usr/local/ssl/lib]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you perform &amp;lt;tt&amp;gt;make install&amp;lt;/tt&amp;gt;, then &amp;lt;tt&amp;gt;ldd&amp;lt;/tt&amp;gt; will produce expected results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ ldd /usr/local/ssl/lib/libssl.so&lt;br /&gt;
linux-vdso.so.1 =&amp;gt;  (0x00007ffceff6c000)&lt;br /&gt;
 ibcrypto.so.1.0.0 =&amp;gt; /usr/local/ssl/lib/libcrypto.so.1.0.0 (0x00007ff5eff96000)&lt;br /&gt;
...&lt;br /&gt;
    &lt;br /&gt;
$ ldd /usr/local/ssl/bin/openssl &lt;br /&gt;
linux-vdso.so.1 =&amp;gt;  (0x00007ffc30d3a000)&lt;br /&gt;
libssl.so.1.0.0 =&amp;gt; /usr/local/ssl/lib/libssl.so.1.0.0 (0x00007f9e8372e000)&lt;br /&gt;
libcrypto.so.1.0.0 =&amp;gt; /usr/local/ssl/lib/libcrypto.so.1.0.0 (0x00007f9e832c0000)&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== FIPS Capable Library ===&lt;br /&gt;
&lt;br /&gt;
If you want to use FIPS validated cryptography, you download, build and install the FIPS Object Module (&amp;lt;tt&amp;gt;openssl-fips-2.0.5.tar.gz&amp;lt;/tt&amp;gt;) according to the [https://www.openssl.org/docs/fips/UserGuide-2.0.pdf FIPS User Guide 2.0] and [https://www.openssl.org/docs/fips/SecurityPolicy-2.0.pdf FIPS 140-2 Security Policy]. You then download, build and install the FIPS Capable Library (&amp;lt;tt&amp;gt;openssl-1.0.1e.tar.gz&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
When configuring the FIPS Capable Library, you must use &amp;lt;tt&amp;gt;fips&amp;lt;/tt&amp;gt; as an option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./config fips &amp;lt;other options ...&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are configuring the FIPS Capable Library with only prime curves (&amp;lt;tt&amp;gt;openssl-fips-ecp-2.0.5.tar.gz&amp;lt;/tt&amp;gt;), then you must configure with &amp;lt;tt&amp;gt;no-ec2m&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./config fips no-ec2m &amp;lt;other options ...&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Compile Time Checking ===&lt;br /&gt;
&lt;br /&gt;
If you disable an option during configure, you can check if it's available through &amp;lt;tt&amp;gt;OPENSSL_NO_*&amp;lt;/tt&amp;gt; defines. OpenSSL writes the configure options to &amp;lt;tt&amp;gt;&amp;lt;openssl/opensslconf.h&amp;gt;&amp;lt;/tt&amp;gt;. For example, if you want to know if SSLv3 is available, then you would perform the following in your code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;openssl/opensslconf.h&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
#if !defined(OPENSSL_NO_SSL3)&lt;br /&gt;
  /* SSLv3 is available */&lt;br /&gt;
#endif&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compilation ==&lt;br /&gt;
&lt;br /&gt;
After configuring the library, you should run &amp;lt;tt&amp;gt;make&amp;lt;/tt&amp;gt;. If prompted, there's usually no need to &amp;lt;tt&amp;gt;make depend&amp;lt;/tt&amp;gt; since you are building from a clean download.&lt;br /&gt;
&lt;br /&gt;
==== Quick ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./config &amp;lt;nowiki&amp;gt;&amp;lt;options ...&amp;gt; --openssldir=/usr/local/ssl&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
make&lt;br /&gt;
make test&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Various options can be found examining the &amp;lt;tt&amp;gt;Configure&amp;lt;/tt&amp;gt; file (there is a well commented block at its top). OpenSSL ships with SSLv2, SSLv3 and Compression enabled by default (see &amp;lt;tt&amp;gt;my $disabled&amp;lt;/tt&amp;gt;), so you might want to use &amp;lt;tt&amp;gt;no-ssl2 no-ssl3&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;no-ssl3&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;no-comp&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Platfom specific ==&lt;br /&gt;
&lt;br /&gt;
=== Linux ===&lt;br /&gt;
&lt;br /&gt;
==== Intel ====&lt;br /&gt;
&lt;br /&gt;
==== ARM ====&lt;br /&gt;
&lt;br /&gt;
==== X32 (ILP32) ====&lt;br /&gt;
&lt;br /&gt;
X32 uses the 32-bit data model (ILP32) on x86_64/amd64. To properly configure for X32 under current OpenSSL distributions, you must use &amp;lt;tt&amp;gt;Configure&amp;lt;/tt&amp;gt; and use the x32 triplet:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ./Configure LIST | grep x32&lt;br /&gt;
linux-x32&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ./Configure linux-x32      &lt;br /&gt;
Configuring OpenSSL version 1.1.0-pre6-dev (0x0x10100006L)&lt;br /&gt;
    no-asan         [default]  OPENSSL_NO_ASAN (skip dir)&lt;br /&gt;
    ...&lt;br /&gt;
Configuring for linux-x32&lt;br /&gt;
CC            =gcc&lt;br /&gt;
CFLAG         =-Wall -O3 -pthread -mx32 -DL_ENDIAN &lt;br /&gt;
SHARED_CFLAG  =-fPIC&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If using an amd64-compatible processor and GCC with that supports &amp;lt;tt&amp;gt;__uint128_t&amp;lt;/tt&amp;gt;, then you usually add &amp;lt;tt&amp;gt;enable-ec_nistp_64_gcc_128 &amp;lt;/tt&amp;gt; in addition to your other flags.&lt;br /&gt;
&lt;br /&gt;
=== Windows ===&lt;br /&gt;
3noch wrote a VERY good guide in 2012 [https://web.archive.org/web/20161123004257/http://developer.covenanteyes.com/building-openssl-for-visual-studio// here] (PLEASE NOTE: the original article is from 2012 and is no longer hosted at the original location; the link provided is from the Internet Archive Wayback Machine).&lt;br /&gt;
&lt;br /&gt;
Like he said in his article, make absolutely sure to create separate directories for 32 and 64 bit versions.&lt;br /&gt;
&lt;br /&gt;
==== W32 / Windows NT - Windows 9x ====&lt;br /&gt;
&lt;br /&gt;
type INSTALL.W32&lt;br /&gt;
&lt;br /&gt;
* you need Perl for Win32.  Unless you will build on Cygwin, you will need ActiveState Perl, available from http://www.activestate.com/ActivePerl.&lt;br /&gt;
* one of the following C compilers:&lt;br /&gt;
** Visual C++&lt;br /&gt;
** Borland C&lt;br /&gt;
** GNU C (Cygwin or MinGW)&lt;br /&gt;
* Netwide Assembler, a.k.a. NASM, available from http://nasm.sourceforge.net/ is required if you intend to utilize assembler modules. Note that NASM is now the only supported assembler.&lt;br /&gt;
&lt;br /&gt;
==== W64 ====&lt;br /&gt;
&lt;br /&gt;
Read first the INSTALL.W64 documentation note containing some specific 64bits information.&lt;br /&gt;
See also INSTALL.W32 that still provides additonnal build information common to both the 64 and 32 bit versions.&lt;br /&gt;
&lt;br /&gt;
You may be surprised: the 64bit artefacts are indeed output in the out32* sub-directories and bear names ending *32.dll. Fact is the 64 bit compile target is so far an incremental change over the legacy 32bit windows target. Numerous compile flags are still labelled &amp;quot;32&amp;quot; although those do apply to both 32 and 64bit targets.&lt;br /&gt;
&lt;br /&gt;
The important pre-requisites are to have PERL available (for essential file processing so as to prepare sources and scripts for the target OS) and of course a C compiler like Microsoft Visual Studio for C/C++. Also note the procedure changed at OpenSSL 1.1.0 and is more streamlined. Also see [https://stackoverflow.com/q/39076244/608639 Why there is no ms\do_ms.bat after perl Configure VC-WIN64A] on Stack Overflow.&lt;br /&gt;
&lt;br /&gt;
=== OpenSSL 1.1.0 ===&lt;br /&gt;
&lt;br /&gt;
For OpenSSL 1.1.0 and above perform these steps:&lt;br /&gt;
&lt;br /&gt;
# Ensure you have perl installed on your machine (e.g. ActiveState or Strawberry), and available on your %PATH%&lt;br /&gt;
# Ensure you have NASM installed on your machine, and available on your %PATH%&lt;br /&gt;
# Extract the source files to your folder, here &amp;lt;code&amp;gt;cd c:\myPath\openssl&amp;lt;/code&amp;gt;&lt;br /&gt;
# Launch Visual Studio tool x64 Cross Tools Command prompt&lt;br /&gt;
# Goto your defined folder &amp;lt;code&amp;gt;cd c:\myPath\openssl&amp;lt;/code&amp;gt;&lt;br /&gt;
# Configure for the target OS with &amp;lt;code&amp;gt;perl Configure VC-WIN64A&amp;lt;/code&amp;gt; or other configurations to be found in the INSTALL file (e.g. UNIX targets). &lt;br /&gt;
## For instance: &amp;lt;code&amp;gt;perl Configure VC-WIN64A&amp;lt;/code&amp;gt;.&lt;br /&gt;
# (''Optional'') In case you compiled before on 32 or 64-bits, make sure you run &amp;lt;code&amp;gt;nmake clean&amp;lt;/code&amp;gt; to prevent trouble across 32 and 64-bits which share output folder.&lt;br /&gt;
# Now build with: &amp;lt;code&amp;gt;nmake&amp;lt;/code&amp;gt;&lt;br /&gt;
# Output can be found in the '''root''' of your folder as '''libcrypto-1_1x64.dll''' and '''libssl-1_1-x64.dll''' (with all the build additionals such as .pdb .lik or static .lib). You may check this is true 64bit code using the Visual Studio tool 'dumpbin'. For instance &amp;lt;code&amp;gt;dumpbin  /headers libcrypto-1_1x64.dll | more&amp;lt;/code&amp;gt;, and look at the FILE HEADER section.&lt;br /&gt;
# Test the code using the 'test' make target, by running &amp;lt;code&amp;gt;nmake test&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Reminder, clean your code to prevent issues the next time you compile for a different target. See step 7.&lt;br /&gt;
&lt;br /&gt;
==== Windows CE ====&lt;br /&gt;
'' Not specified ''&lt;br /&gt;
&lt;br /&gt;
=== OpenSSL 1.0.2 ===&lt;br /&gt;
&lt;br /&gt;
For OpenSSL 1.0.2 and earlier the procedure is as follows.&lt;br /&gt;
&lt;br /&gt;
# Ensure you have perl installed on your machine (e.g. ActiveState or Strawberry), and available on your %PATH%&lt;br /&gt;
# Ensure you have NASM installed on your machine, and available on your %PATH%&lt;br /&gt;
# launch a Visual Studio tool x64 Cross Tools Command prompt&lt;br /&gt;
# change to the directory where you have copied openssl sources &amp;lt;code&amp;gt;cd c:\myPath\openssl&amp;lt;/code&amp;gt;&lt;br /&gt;
# configure for the target OS with the command &amp;lt;code&amp;gt;perl Configure VC-WIN64A&amp;lt;/code&amp;gt;. You may also be interested to set more configuration options as documented in the general INSTALL note (for UNIX targets). For instance: &amp;lt;code&amp;gt;perl Configure VC-WIN64A&amp;lt;/code&amp;gt;.&lt;br /&gt;
# prepare the target environment with the command: &amp;lt;code&amp;gt;ms\do_win64a&amp;lt;/code&amp;gt;&lt;br /&gt;
# ensure you start afresh and notably without linkable products from a previous 32bit compile (as 32 and 64 bits compiling still share common directories) with the command: &amp;lt;code&amp;gt;nmake -f ms\ntdll.mak clean&amp;lt;/code&amp;gt; for the DLL target and &amp;lt;code&amp;gt;nmake -f ms\nt.mak clean&amp;lt;/code&amp;gt; for static libraries.&lt;br /&gt;
# build the code with: &amp;lt;code&amp;gt;nmake -f ms\ntdll.mak&amp;lt;/code&amp;gt; (respectively &amp;lt;code&amp;gt;nmake -f ms\nt.mak&amp;lt;/code&amp;gt; )&lt;br /&gt;
# the artefacts will be found in sub directories out32dll and out32dll.dbg (respectively out32 and out32.dbg for static libraries). The libcrypto and ssl libraries are still named libeay32.lib and ssleay32.lib, and associated includes in inc32 ! You may check this is true 64bit code using the Visual Studio tool 'dumpbin'. For instance &amp;lt;code&amp;gt;dumpbin  /headers out32dll/libeay32.lib | more&amp;lt;/code&amp;gt;, and look at the FILE HEADER section.&lt;br /&gt;
# test the code using the various *test.exe programs in out32dll. Use the 'test' make target to run all tests as in &amp;lt;code&amp;gt;nmake -f ms\ntdll.mak test&amp;lt;/code&amp;gt;&lt;br /&gt;
# we recommend that you move/copy needed includes and libraries from the &amp;quot;32&amp;quot; directories under a new explicit directory tree for 64bit applications from where you will import and link your target applications, similar to that explained in INSTALL.W32.&lt;br /&gt;
&lt;br /&gt;
==== Windows CE ====&lt;br /&gt;
&lt;br /&gt;
=== OS X ===&lt;br /&gt;
&lt;br /&gt;
The earlier discussion presented a lot of information (and some of it had OS X information). Here are the TLDR versions to configure, build and install the library.&lt;br /&gt;
&lt;br /&gt;
If configuring for 64-bit OS X, then use a command similar to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./Configure darwin64-x86_64-cc shared enable-ec_nistp_64_gcc_128 no-ssl2 no-ssl3 no-comp --openssldir=/usr/local/ssl/macos-x86_64&lt;br /&gt;
make depend&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If configuring for 32-bit OS X, then use a command similar to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;./Configure darwin-i386-cc shared no-ssl2 no-ssl3 no-comp --openssldir=/usr/local/ssl/macosx-i386&lt;br /&gt;
make depend&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to build a multiarch OpenSSL library, then see this answer on Stack Overflow: [http://stackoverflow.com/a/25531033/608639 Build Multiarch OpenSSL on OS X].&lt;br /&gt;
&lt;br /&gt;
=== iOS ===&lt;br /&gt;
&lt;br /&gt;
The following builds OpenSSL for iOS using the iPhoneOS SDK. The configuration avoids the dynamic library the DSO interface and engines.&lt;br /&gt;
&lt;br /&gt;
If you run &amp;lt;tt&amp;gt;make install&amp;lt;/tt&amp;gt;, then the headers will be installed in &amp;lt;tt&amp;gt;/usr/local/openssl-ios/include&amp;lt;/tt&amp;gt; and libraries will be installed in &amp;lt;tt&amp;gt;/usr/local/openssl-ios/lib&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== 32-bit ====&lt;br /&gt;
&lt;br /&gt;
For OpenSSL 1.1.0 and above, a 32-bit iOS cross-compiles uses the &amp;lt;tt&amp;gt;ios-cross&amp;lt;/tt&amp;gt; target, and options similar to &amp;lt;tt&amp;gt;--prefix=/usr/local/openssl-ios&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ export CC=clang;&lt;br /&gt;
$ export CROSS_TOP=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer&lt;br /&gt;
$ export CROSS_SDK=iPhoneOS.sdk&lt;br /&gt;
$ export PATH=&amp;quot;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:$PATH&amp;quot;&lt;br /&gt;
&lt;br /&gt;
$ ./Configure ios-cross no-shared no-dso no-hw no-engine --prefix=/usr/local/openssl-ios&lt;br /&gt;
&lt;br /&gt;
Configuring OpenSSL version 1.1.1-dev (0x10101000L)&lt;br /&gt;
    no-afalgeng     [forced]   OPENSSL_NO_AFALGENG&lt;br /&gt;
    no-asan         [default]  OPENSSL_NO_ASAN&lt;br /&gt;
    no-dso          [option]&lt;br /&gt;
    no-dynamic-engine [forced]&lt;br /&gt;
    ...&lt;br /&gt;
    no-weak-ssl-ciphers [default]  OPENSSL_NO_WEAK_SSL_CIPHERS&lt;br /&gt;
    no-zlib         [default]&lt;br /&gt;
    no-zlib-dynamic [default]&lt;br /&gt;
Configuring for ios-cross&lt;br /&gt;
&lt;br /&gt;
PERL          =perl&lt;br /&gt;
PERLVERSION   =5.16.2 for darwin-thread-multi-2level&lt;br /&gt;
HASHBANGPERL  =/usr/bin/env perl&lt;br /&gt;
CC            =clang&lt;br /&gt;
CFLAG         =-O3 -D_REENTRANT -arch armv7 -mios-version-min=6.0.0 -isysroot $(CROSS_TOP)/SDKs/$(CROSS_SDK) -fno-common&lt;br /&gt;
CXX           =c++&lt;br /&gt;
CXXFLAG       =-O3 -D_REENTRANT -arch armv7 -mios-version-min=6.0.0 -isysroot $(CROSS_TOP)/SDKs/$(CROSS_SDK) -fno-common&lt;br /&gt;
DEFINES       =NDEBUG OPENSSL_THREADS OPENSSL_NO_DYNAMIC_ENGINE OPENSSL_PIC OPENSSL_BN_ASM_MONT OPENSSL_BN_ASM_GF2m SHA1_ASM SHA256_ASM SHA512_ASM AES_ASM BSAES_ASM GHASH_ASM ECP_NISTZ256_ASM POLY1305_ASM&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are working with OpenSSL 1.0.2 or below, then use the &amp;lt;tt&amp;gt;iphoneos-cross&amp;lt;/tt&amp;gt; target.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ export CC=clang;&lt;br /&gt;
$ export CROSS_TOP=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer&lt;br /&gt;
$ export CROSS_SDK=iPhoneOS.sdk&lt;br /&gt;
$ export PATH=&amp;quot;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:$PATH&amp;quot;&lt;br /&gt;
&lt;br /&gt;
$ ./Configure iphoneos-cross no-shared no-dso no-hw no-engine --prefix=/usr/local/openssl-ios&lt;br /&gt;
Configuring for iphoneos-cross&lt;br /&gt;
    no-dso          [option]&lt;br /&gt;
    no-engine       [option]   OPENSSL_NO_ENGINE (skip dir)&lt;br /&gt;
    no-gmp          [default]  OPENSSL_NO_GMP (skip dir)&lt;br /&gt;
    no-hw           [option]   OPENSSL_NO_HW&lt;br /&gt;
    ...&lt;br /&gt;
    no-weak-ssl-ciphers [default]  OPENSSL_NO_WEAK_SSL_CIPHERS (skip dir)&lt;br /&gt;
    no-zlib         [default]&lt;br /&gt;
    no-zlib-dynamic [default]&lt;br /&gt;
IsMK1MF=0&lt;br /&gt;
CC            =clang&lt;br /&gt;
CFLAG         =-DOPENSSL_THREADS -D_REENTRANT -O3 -isysroot $(CROSS_TOP)/SDKs/$(CROSS_SDK) -fomit-frame-pointer -fno-common&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 64-bit ====&lt;br /&gt;
&lt;br /&gt;
For OpenSSL 1.1.0 , a 64-bit iOS cross-compiles uses the &amp;lt;tt&amp;gt;ios64-cross&amp;lt;/tt&amp;gt; target, and &amp;lt;tt&amp;gt;--prefix=/usr/local/openssl-ios64&amp;lt;/tt&amp;gt;. &amp;lt;tt&amp;gt;ios64-cross&amp;lt;/tt&amp;gt;. There is no built-in 64-bit iOS support for OpenSSL 1.0.2 or below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ export CC=clang;&lt;br /&gt;
$ export CROSS_TOP=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer&lt;br /&gt;
$ export CROSS_SDK=iPhoneOS.sdk&lt;br /&gt;
$ export PATH=&amp;quot;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:$PATH&amp;quot;&lt;br /&gt;
&lt;br /&gt;
$ ./Configure ios64-cross no-shared no-dso no-hw no-engine --prefix=/usr/local/openssl-ios64&lt;br /&gt;
&lt;br /&gt;
Configuring OpenSSL version 1.1.1-dev (0x10101000L)&lt;br /&gt;
    no-afalgeng     [forced]   OPENSSL_NO_AFALGENG&lt;br /&gt;
    no-asan         [default]  OPENSSL_NO_ASAN&lt;br /&gt;
    no-dso          [option]&lt;br /&gt;
    no-dynamic-engine [forced]&lt;br /&gt;
    ...&lt;br /&gt;
    no-weak-ssl-ciphers [default]  OPENSSL_NO_WEAK_SSL_CIPHERS&lt;br /&gt;
    no-zlib         [default]&lt;br /&gt;
    no-zlib-dynamic [default]&lt;br /&gt;
Configuring for ios64-cross&lt;br /&gt;
&lt;br /&gt;
PERL          =perl&lt;br /&gt;
PERLVERSION   =5.16.2 for darwin-thread-multi-2level&lt;br /&gt;
HASHBANGPERL  =/usr/bin/env perl&lt;br /&gt;
CC            =clang&lt;br /&gt;
CFLAG         =-O3 -D_REENTRANT -arch arm64 -mios-version-min=7.0.0 -isysroot $(CROSS_TOP)/SDKs/$(CROSS_SDK) -fno-common&lt;br /&gt;
CXX           =c++&lt;br /&gt;
CXXFLAG       =-O3 -D_REENTRANT -arch arm64 -mios-version-min=7.0.0 -isysroot $(CROSS_TOP)/SDKs/$(CROSS_SDK) -fno-common&lt;br /&gt;
DEFINES       =NDEBUG OPENSSL_THREADS OPENSSL_NO_DYNAMIC_ENGINE OPENSSL_PIC OPENSSL_BN_ASM_MONT SHA1_ASM SHA256_ASM SHA512_ASM VPAES_ASM ECP_NISTZ256_ASM POLY1305_ASM&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Android ===&lt;br /&gt;
&lt;br /&gt;
Visit [[Android]] and [[FIPS Library and Android]].&lt;br /&gt;
&lt;br /&gt;
=== More ===&lt;br /&gt;
&lt;br /&gt;
==== VAX/VMS ====&lt;br /&gt;
&lt;br /&gt;
I you wonder what are files ending with .com like test/testca.com those are VAX/VMX scripts.&lt;br /&gt;
This code is still maintained.&lt;br /&gt;
&lt;br /&gt;
==== OS/2 ====&lt;br /&gt;
&lt;br /&gt;
==== NetWare ====&lt;br /&gt;
5.x 6.x&lt;br /&gt;
&lt;br /&gt;
==== HP-UX ====&lt;br /&gt;
[[HP-UX Itanium FIPS and OpenSSL build]]&lt;br /&gt;
&lt;br /&gt;
==Autoconf==&lt;br /&gt;
&lt;br /&gt;
OpenSSL uses its own configuration system, and does not use Autoconf. However, a number of popular projects use both OpenSSL and Autoconf, and it would be useful to detect either &amp;lt;tt&amp;gt;OPENSSL_init_ssl&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;SSL_library_init&amp;lt;/tt&amp;gt; from &amp;lt;tt&amp;gt;libssl&amp;lt;/tt&amp;gt;. To craft a feature test for OpenSSL that recognizes both &amp;lt;tt&amp;gt;OPENSSL_init_ssl&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;SSL_library_init&amp;lt;/tt&amp;gt;, you can use the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;if test &amp;quot;$with_openssl&amp;quot; = yes ; then&lt;br /&gt;
  dnl Order matters!&lt;br /&gt;
  if test &amp;quot;$PORTNAME&amp;quot; != &amp;quot;win32&amp;quot;; then&lt;br /&gt;
     AC_CHECK_LIB(crypto, CRYPTO_new_ex_data, [], [AC_MSG_ERROR([library 'crypto' is required for OpenSSL])])&lt;br /&gt;
     FOUND_SSL_LIB=&amp;quot;no&amp;quot;&lt;br /&gt;
     AC_CHECK_LIB(ssl, OPENSSL_init_ssl, [FOUND_SSL_LIB=&amp;quot;yes&amp;quot;])&lt;br /&gt;
     AC_CHECK_LIB(ssl, SSL_library_init, [FOUND_SSL_LIB=&amp;quot;yes&amp;quot;])&lt;br /&gt;
     AS_IF([test &amp;quot;x$FOUND_SSL_LIB&amp;quot; = xno], [AC_MSG_ERROR([library 'ssl' is required for OpenSSL])])&lt;br /&gt;
  else&lt;br /&gt;
     AC_SEARCH_LIBS(CRYPTO_new_ex_data, eay32 crypto, [], [AC_MSG_ERROR([library 'eay32' or 'crypto' is required for OpenSSL])])&lt;br /&gt;
     FOUND_SSL_LIB=&amp;quot;no&amp;quot;&lt;br /&gt;
     AC_SEARCH_LIBS(OPENSSL_init_ssl, ssleay32 ssl, [FOUND_SSL_LIB=&amp;quot;yes&amp;quot;])&lt;br /&gt;
     AC_SEARCH_LIBS(SSL_library_init, ssleay32 ssl, [FOUND_SSL_LIB=&amp;quot;yes&amp;quot;])&lt;br /&gt;
     AS_IF([test &amp;quot;x$FOUND_SSL_LIB&amp;quot; = xno], [AC_MSG_ERROR([library 'ssleay32' or 'ssl' is required for OpenSSL])])&lt;br /&gt;
  fi&lt;br /&gt;
fi&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many thanks to the Postgres folks for donating part of their &amp;lt;tt&amp;gt;configure.in&amp;lt;/tt&amp;gt;. Also see [http://stackoverflow.com/q/39285733 How to tell Autoconf “require symbol A or B” from LIB?] on Stack Overflow.&lt;br /&gt;
&lt;br /&gt;
[[Category:Shell level]]&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
[[Category:Compilation]]&lt;/div&gt;</summary>
		<author><name>Lmcnerney</name></author>
	</entry>
</feed>