<?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=Zevisert</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=Zevisert"/>
	<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php/Special:Contributions/Zevisert"/>
	<updated>2026-05-16T00:29:49Z</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=2423</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=2423"/>
		<updated>2016-07-06T21:27:19Z</updated>

		<summary type="html">&lt;p&gt;Zevisert: /* W64 */ dumbin -&amp;gt; dumpbin&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.&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. Its currently available in Master through Git. 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.&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 high (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;
=== 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;
{| 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&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 (useful on mobile devices since carriers often block UDP)&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-engines || 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;
| -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 location of the installed components. The behavior and iterations among &amp;lt;tt&amp;gt;--prefix&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;--openssldir&amp;lt;/tt&amp;gt; is slightly different between OpenSSL 1.0.2 and below, and OpenSSL 1.1.0 and above.&lt;br /&gt;
&lt;br /&gt;
One thing you should avoid is using &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., and it will most likely break everything, including the package management system.&lt;br /&gt;
&lt;br /&gt;
'''OpenSSL 1.0.2 and below'''&lt;br /&gt;
&lt;br /&gt;
It is ''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. 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;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''OpenSSL 1.1.0 and above'''&lt;br /&gt;
&lt;br /&gt;
TODO - add rules...&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;
=== 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. One of the easiest ways to add a &amp;lt;tt&amp;gt;RPATH&amp;lt;/tt&amp;gt; is to perform:&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;
You can also add and &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;, named 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 [http://developer.covenanteyes.com/building-openssl-for-visual-studio/ here].&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++.&lt;br /&gt;
&lt;br /&gt;
Using MS Visual Studio:&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 no-asm 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;
=== Mac ===&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;
=== 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;
[[Category:Shell level]]&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
[[Category:Compilation]]&lt;/div&gt;</summary>
		<author><name>Zevisert</name></author>
	</entry>
</feed>