INSTALL 56 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282
  1. OPENSSL INSTALLATION
  2. --------------------
  3. This document describes installation on all supported operating
  4. systems (the Unix/Linux family (which includes Mac OS/X), OpenVMS,
  5. and Windows).
  6. To install OpenSSL, you will need:
  7. * A make implementation
  8. * Perl 5 with core modules (please read NOTES.PERL)
  9. * The perl module Text::Template (please read NOTES.PERL)
  10. * an ANSI C compiler
  11. * a development environment in the form of development libraries and C
  12. header files
  13. * a supported operating system
  14. For additional platform specific requirements, solutions to specific
  15. issues and other details, please read one of these:
  16. * NOTES.UNIX (any supported Unix like system)
  17. * NOTES.VMS (OpenVMS)
  18. * NOTES.WIN (any supported Windows)
  19. * NOTES.DJGPP (DOS platform with DJGPP)
  20. * NOTES.ANDROID (obviously Android [NDK])
  21. * NOTES.VALGRIND (testing with Valgrind)
  22. Notational conventions in this document
  23. ---------------------------------------
  24. Throughout this document, we use the following conventions in command
  25. examples:
  26. $ command Any line starting with a dollar sign
  27. ($) is a command line.
  28. { word1 | word2 | word3 } This denotes a mandatory choice, to be
  29. replaced with one of the given words.
  30. A simple example would be this:
  31. $ echo { FOO | BAR | COOKIE }
  32. which is to be understood as one of
  33. these:
  34. $ echo FOO
  35. - or -
  36. $ echo BAR
  37. - or -
  38. $ echo COOKIE
  39. [ word1 | word2 | word3 ] Similar to { word1 | word2 | word3 }
  40. except it's optional to give any of
  41. those. In addition to the examples
  42. above, this would also be valid:
  43. $ echo
  44. {{ target }} This denotes a mandatory word or
  45. sequence of words of some sort. A
  46. simple example would be this:
  47. $ type {{ filename }}
  48. which is to be understood to use the
  49. command 'type' on some file name
  50. determined by the user.
  51. [[ options ]] Similar to {{ target }}, but is
  52. optional.
  53. Note that the notation assumes spaces around {, }, [, ], {{, }} and
  54. [[, ]]. This is to differentiate from OpenVMS directory
  55. specifications, which also use [ and ], but without spaces.
  56. Quick Start
  57. -----------
  58. If you want to just get on with it, do:
  59. on Unix (again, this includes Mac OS/X):
  60. $ ./config
  61. $ make
  62. $ make test
  63. $ make install
  64. on OpenVMS:
  65. $ @config
  66. $ mms
  67. $ mms test
  68. $ mms install
  69. on Windows (only pick one of the targets for configuration):
  70. $ perl Configure { VC-WIN32 | VC-WIN64A | VC-WIN64I | VC-CE }
  71. $ nmake
  72. $ nmake test
  73. $ nmake install
  74. If any of these steps fails, see section Installation in Detail below.
  75. This will build and install OpenSSL in the default location, which is:
  76. Unix: normal installation directories under /usr/local
  77. OpenVMS: SYS$COMMON:[OPENSSL-'version'...], where 'version' is the
  78. OpenSSL version number with underscores instead of periods.
  79. Windows: C:\Program Files\OpenSSL or C:\Program Files (x86)\OpenSSL
  80. If you want to install it anywhere else, run config like this:
  81. On Unix:
  82. $ ./config --prefix=/opt/openssl --openssldir=/usr/local/ssl
  83. On OpenVMS:
  84. $ @config --prefix=PROGRAM:[INSTALLS] --openssldir=SYS$MANAGER:[OPENSSL]
  85. (Note: if you do add options to the configuration command, please make sure
  86. you've read more than just this Quick Start, such as relevant NOTES.* files,
  87. the options outline below, as configuration options may change the outcome
  88. in otherwise unexpected ways)
  89. Configuration Options
  90. ---------------------
  91. There are several options to ./config (or ./Configure) to customize
  92. the build (note that for Windows, the defaults for --prefix and
  93. --openssldir depend in what configuration is used and what Windows
  94. implementation OpenSSL is built on. More notes on this in NOTES.WIN):
  95. --api=x.y.z
  96. Don't build with support for deprecated APIs below the
  97. specified version number. For example "--api=1.1.0" will
  98. remove support for all APIS that were deprecated in OpenSSL
  99. version 1.1.0 or below.
  100. --cross-compile-prefix=PREFIX
  101. The PREFIX to include in front of commands for your
  102. toolchain. It's likely to have to end with dash, e.g.
  103. a-b-c- would invoke GNU compiler as a-b-c-gcc, etc.
  104. Unfortunately cross-compiling is too case-specific to
  105. put together one-size-fits-all instructions. You might
  106. have to pass more flags or set up environment variables
  107. to actually make it work. Android and iOS cases are
  108. discussed in corresponding Configurations/15-*.conf
  109. files. But there are cases when this option alone is
  110. sufficient. For example to build the mingw64 target on
  111. Linux "--cross-compile-prefix=x86_64-w64-mingw32-"
  112. works. Naturally provided that mingw packages are
  113. installed. Today Debian and Ubuntu users have option to
  114. install a number of prepackaged cross-compilers along
  115. with corresponding run-time and development packages for
  116. "alien" hardware. To give another example
  117. "--cross-compile-prefix=mipsel-linux-gnu-" suffices
  118. in such case. Needless to mention that you have to
  119. invoke ./Configure, not ./config, and pass your target
  120. name explicitly. Also, note that --openssldir refers
  121. to target's file system, not one you are building on.
  122. --debug
  123. Build OpenSSL with debugging symbols and zero optimization
  124. level.
  125. --libdir=DIR
  126. The name of the directory under the top of the installation
  127. directory tree (see the --prefix option) where libraries will
  128. be installed. By default this is "lib". Note that on Windows
  129. only ".lib" files will be stored in this location. dll files
  130. will always be installed to the "bin" directory.
  131. --openssldir=DIR
  132. Directory for OpenSSL configuration files, and also the
  133. default certificate and key store. Defaults are:
  134. Unix: /usr/local/ssl
  135. Windows: C:\Program Files\Common Files\SSL
  136. or C:\Program Files (x86)\Common Files\SSL
  137. OpenVMS: SYS$COMMON:[OPENSSL-COMMON]
  138. --prefix=DIR
  139. The top of the installation directory tree. Defaults are:
  140. Unix: /usr/local
  141. Windows: C:\Program Files\OpenSSL
  142. or C:\Program Files (x86)\OpenSSL
  143. OpenVMS: SYS$COMMON:[OPENSSL-'version']
  144. --release
  145. Build OpenSSL without debugging symbols. This is the default.
  146. --strict-warnings
  147. This is a developer flag that switches on various compiler
  148. options recommended for OpenSSL development. It only works
  149. when using gcc or clang as the compiler. If you are
  150. developing a patch for OpenSSL then it is recommended that
  151. you use this option where possible.
  152. --with-zlib-include=DIR
  153. The directory for the location of the zlib include file. This
  154. option is only necessary if enable-zlib (see below) is used
  155. and the include file is not already on the system include
  156. path.
  157. --with-zlib-lib=LIB
  158. On Unix: this is the directory containing the zlib library.
  159. If not provided the system library path will be used.
  160. On Windows: this is the filename of the zlib library (with or
  161. without a path). This flag must be provided if the
  162. zlib-dynamic option is not also used. If zlib-dynamic is used
  163. then this flag is optional and a default value ("ZLIB1") is
  164. used if not provided.
  165. On VMS: this is the filename of the zlib library (with or
  166. without a path). This flag is optional and if not provided
  167. then "GNV$LIBZSHR", "GNV$LIBZSHR32" or "GNV$LIBZSHR64" is
  168. used by default depending on the pointer size chosen.
  169. --with-rand-seed=seed1[,seed2,...]
  170. A comma separated list of seeding methods which will be tried
  171. by OpenSSL in order to obtain random input (a.k.a "entropy")
  172. for seeding its cryptographically secure random number
  173. generator (CSPRNG). The current seeding methods are:
  174. os: Use a trusted operating system entropy source.
  175. This is the default method if such an entropy
  176. source exists.
  177. getrandom: Use the L<getrandom(2)> or equivalent system
  178. call.
  179. devrandom: Use the the first device from the DEVRANDOM list
  180. which can be opened to read random bytes. The
  181. DEVRANDOM preprocessor constant expands to
  182. "/dev/urandom","/dev/random","/dev/srandom" on
  183. most unix-ish operating systems.
  184. egd: Check for an entropy generating daemon.
  185. rdcpu: Use the RDSEED or RDRAND command if provided by
  186. the CPU.
  187. librandom: Use librandom (not implemented yet).
  188. none: Disable automatic seeding. This is the default
  189. on some operating systems where no suitable
  190. entropy source exists, or no support for it is
  191. implemented yet.
  192. For more information, see the section 'Note on random number
  193. generation' at the end of this document.
  194. no-afalgeng
  195. Don't build the AFALG engine. This option will be forced if
  196. on a platform that does not support AFALG.
  197. enable-ktls
  198. Build with Kernel TLS support. This option will enable the
  199. use of the Kernel TLS data-path, which can improve
  200. performance and allow for the use of sendfile and splice
  201. system calls on TLS sockets. The Kernel may use TLS
  202. accelerators if any are available on the system.
  203. This option will be forced off on systems that do not support
  204. the Kernel TLS data-path.
  205. enable-asan
  206. Build with the Address sanitiser. This is a developer option
  207. only. It may not work on all platforms and should never be
  208. used in production environments. It will only work when used
  209. with gcc or clang and should be used in conjunction with the
  210. no-shared option.
  211. no-asm
  212. Do not use assembler code. This should be viewed as
  213. debugging/trouble-shooting option rather than production.
  214. On some platforms a small amount of assembler code may
  215. still be used even with this option.
  216. no-async
  217. Do not build support for async operations.
  218. no-autoalginit
  219. Don't automatically load all supported ciphers and digests.
  220. Typically OpenSSL will make available all of its supported
  221. ciphers and digests. For a statically linked application this
  222. may be undesirable if small executable size is an objective.
  223. This only affects libcrypto. Ciphers and digests will have to
  224. be loaded manually using EVP_add_cipher() and
  225. EVP_add_digest() if this option is used. This option will
  226. force a non-shared build.
  227. no-autoerrinit
  228. Don't automatically load all libcrypto/libssl error strings.
  229. Typically OpenSSL will automatically load human readable
  230. error strings. For a statically linked application this may
  231. be undesirable if small executable size is an objective.
  232. no-autoload-config
  233. Don't automatically load the default openssl.cnf file.
  234. Typically OpenSSL will automatically load a system config
  235. file which configures default ssl options.
  236. enable-buildtest-c++
  237. While testing, generate C++ buildtest files that
  238. simply check that the public OpenSSL header files
  239. are usable standalone with C++.
  240. Enabling this option demands extra care. For any
  241. compiler flag given directly as configuration
  242. option, you must ensure that it's valid for both
  243. the C and the C++ compiler. If not, the C++ build
  244. test will most likely break. As an alternative,
  245. you can use the language specific variables, CFLAGS
  246. and CXXFLAGS.
  247. no-capieng
  248. Don't build the CAPI engine. This option will be forced if
  249. on a platform that does not support CAPI.
  250. no-cms
  251. Don't build support for CMS features
  252. no-comp
  253. Don't build support for SSL/TLS compression. If this option
  254. is left enabled (the default), then compression will only
  255. work if the zlib or zlib-dynamic options are also chosen.
  256. enable-crypto-mdebug
  257. Build support for debugging memory allocated via
  258. OPENSSL_malloc() or OPENSSL_zalloc().
  259. enable-crypto-mdebug-backtrace
  260. As for crypto-mdebug, but additionally provide backtrace
  261. information for allocated memory.
  262. TO BE USED WITH CARE: this uses GNU C functionality, and
  263. is therefore not usable for non-GNU config targets. If
  264. your build complains about the use of '-rdynamic' or the
  265. lack of header file execinfo.h, this option is not for you.
  266. ALSO NOTE that even though execinfo.h is available on your
  267. system (through Gnulib), the functions might just be stubs
  268. that do nothing.
  269. no-ct
  270. Don't build support for Certificate Transparency.
  271. no-deprecated
  272. Don't build with support for any deprecated APIs. This is the
  273. same as using "--api" and supplying the latest version
  274. number.
  275. no-dgram
  276. Don't build support for datagram based BIOs. Selecting this
  277. option will also force the disabling of DTLS.
  278. enable-devcryptoeng
  279. Build the /dev/crypto engine. It is automatically selected
  280. on BSD implementations, in which case it can be disabled with
  281. no-devcryptoeng.
  282. no-dynamic-engine
  283. Don't build the dynamically loaded engines. This only has an
  284. effect in a "shared" build
  285. no-ec
  286. Don't build support for Elliptic Curves.
  287. no-ec2m
  288. Don't build support for binary Elliptic Curves
  289. enable-ec_nistp_64_gcc_128
  290. Enable support for optimised implementations of some commonly
  291. used NIST elliptic curves.
  292. This is only supported on platforms:
  293. - with little-endian storage of non-byte types
  294. - that tolerate misaligned memory references
  295. - where the compiler:
  296. - supports the non-standard type __uint128_t
  297. - defines the built-in macro __SIZEOF_INT128__
  298. enable-egd
  299. Build support for gathering entropy from EGD (Entropy
  300. Gathering Daemon).
  301. no-engine
  302. Don't build support for loading engines.
  303. no-err
  304. Don't compile in any error strings.
  305. enable-external-tests
  306. Enable building of integration with external test suites.
  307. This is a developer option and may not work on all platforms.
  308. The only supported external test suite at the current time is
  309. the BoringSSL test suite. See the file test/README.external
  310. for further details.
  311. no-filenames
  312. Don't compile in filename and line number information (e.g.
  313. for errors and memory allocation).
  314. no-fips
  315. Don't compile the FIPS module
  316. enable-fuzz-libfuzzer, enable-fuzz-afl
  317. Build with support for fuzzing using either libfuzzer or AFL.
  318. These are developer options only. They may not work on all
  319. platforms and should never be used in production environments.
  320. See the file fuzz/README.md for further details.
  321. no-gost
  322. Don't build support for GOST based ciphersuites. Note that
  323. if this feature is enabled then GOST ciphersuites are only
  324. available if the GOST algorithms are also available through
  325. loading an externally supplied engine.
  326. no-legacy
  327. Don't build the legacy provider. Disabling this also disables
  328. the legacy algorithms: MD2 (already disabled by default).
  329. no-makedepend
  330. Don't generate dependencies.
  331. no-module
  332. Don't build any dynamically loadable engines. This also
  333. implies 'no-dynamic-engine'.
  334. no-multiblock
  335. Don't build support for writing multiple records in one
  336. go in libssl (Note: this is a different capability to the
  337. pipelining functionality).
  338. no-nextprotoneg
  339. Don't build support for the NPN TLS extension.
  340. no-ocsp
  341. Don't build support for OCSP.
  342. no-padlockeng
  343. no-hw-padlock
  344. Don't build the padlock engine.
  345. ('no-hw-padlock' is deprecated and should not be used)
  346. no-pic
  347. Don't build with support for Position Independent Code.
  348. no-pinshared By default OpenSSL will attempt to stay in memory until the
  349. process exits. This is so that libcrypto and libssl can be
  350. properly cleaned up automatically via an "atexit()" handler.
  351. The handler is registered by libcrypto and cleans up both
  352. libraries. On some platforms the atexit() handler will run on
  353. unload of libcrypto (if it has been dynamically loaded)
  354. rather than at process exit. This option can be used to stop
  355. OpenSSL from attempting to stay in memory until the process
  356. exits. This could lead to crashes if either libcrypto or
  357. libssl have already been unloaded at the point
  358. that the atexit handler is invoked, e.g. on a platform which
  359. calls atexit() on unload of the library, and libssl is
  360. unloaded before libcrypto then a crash is likely to happen.
  361. Applications can suppress running of the atexit() handler at
  362. run time by using the OPENSSL_INIT_NO_ATEXIT option to
  363. OPENSSL_init_crypto(). See the man page for it for further
  364. details.
  365. no-posix-io
  366. Don't use POSIX IO capabilities.
  367. no-psk
  368. Don't build support for Pre-Shared Key based ciphersuites.
  369. no-rdrand
  370. Don't use hardware RDRAND capabilities.
  371. no-rfc3779
  372. Don't build support for RFC3779 ("X.509 Extensions for IP
  373. Addresses and AS Identifiers")
  374. sctp
  375. Build support for SCTP
  376. no-shared
  377. Do not create shared libraries, only static ones. See "Note
  378. on shared libraries" below.
  379. no-sock
  380. Don't build support for socket BIOs
  381. no-srp
  382. Don't build support for SRP or SRP based ciphersuites.
  383. no-srtp
  384. Don't build SRTP support
  385. no-sse2
  386. Exclude SSE2 code paths from 32-bit x86 assembly modules.
  387. Normally SSE2 extension is detected at run-time, but the
  388. decision whether or not the machine code will be executed
  389. is taken solely on CPU capability vector. This means that
  390. if you happen to run OS kernel which does not support SSE2
  391. extension on Intel P4 processor, then your application
  392. might be exposed to "illegal instruction" exception.
  393. There might be a way to enable support in kernel, e.g.
  394. FreeBSD kernel can be compiled with CPU_ENABLE_SSE, and
  395. there is a way to disengage SSE2 code paths upon application
  396. start-up, but if you aim for wider "audience" running
  397. such kernel, consider no-sse2. Both the 386 and
  398. no-asm options imply no-sse2.
  399. enable-ssl-trace
  400. Build with the SSL Trace capabilities (adds the "-trace"
  401. option to s_client and s_server).
  402. no-static-engine
  403. Don't build the statically linked engines. This only
  404. has an impact when not built "shared".
  405. no-stdio
  406. Don't use anything from the C header file "stdio.h" that
  407. makes use of the "FILE" type. Only libcrypto and libssl can
  408. be built in this way. Using this option will suppress
  409. building the command line applications. Additionally since
  410. the OpenSSL tests also use the command line applications the
  411. tests will also be skipped.
  412. no-tests
  413. Don't build test programs or run any test.
  414. no-threads
  415. Don't try to build with support for multi-threaded
  416. applications.
  417. threads
  418. Build with support for multi-threaded applications. Most
  419. platforms will enable this by default. However if on a
  420. platform where this is not the case then this will usually
  421. require additional system-dependent options! See "Note on
  422. multi-threading" below.
  423. enable-trace
  424. Build with support for the integrated tracing api. See manual pages
  425. OSSL_trace_set_channel(3) and OSSL_trace_enabled(3) for details.
  426. no-ts
  427. Don't build Time Stamping Authority support.
  428. enable-ubsan
  429. Build with the Undefined Behaviour sanitiser. This is a
  430. developer option only. It may not work on all platforms and
  431. should never be used in production environments. It will only
  432. work when used with gcc or clang and should be used in
  433. conjunction with the "-DPEDANTIC" option (or the
  434. --strict-warnings option).
  435. no-ui
  436. Don't build with the "UI" capability (i.e. the set of
  437. features enabling text based prompts).
  438. enable-unit-test
  439. Enable additional unit test APIs. This should not typically
  440. be used in production deployments.
  441. enable-weak-ssl-ciphers
  442. Build support for SSL/TLS ciphers that are considered "weak"
  443. (e.g. RC4 based ciphersuites).
  444. zlib
  445. Build with support for zlib compression/decompression.
  446. zlib-dynamic
  447. Like "zlib", but has OpenSSL load the zlib library
  448. dynamically when needed. This is only supported on systems
  449. where loading of shared libraries is supported.
  450. 386
  451. In 32-bit x86 builds, when generating assembly modules,
  452. use the 80386 instruction set only (the default x86 code
  453. is more efficient, but requires at least a 486). Note:
  454. This doesn't affect code generated by compiler, you're
  455. likely to complement configuration command line with
  456. suitable compiler-specific option.
  457. no-<prot>
  458. Don't build support for negotiating the specified SSL/TLS
  459. protocol (one of ssl, ssl3, tls, tls1, tls1_1, tls1_2,
  460. tls1_3, dtls, dtls1 or dtls1_2). If "no-tls" is selected then
  461. all of tls1, tls1_1, tls1_2 and tls1_3 are disabled.
  462. Similarly "no-dtls" will disable dtls1 and dtls1_2. The
  463. "no-ssl" option is synonymous with "no-ssl3". Note this only
  464. affects version negotiation. OpenSSL will still provide the
  465. methods for applications to explicitly select the individual
  466. protocol versions.
  467. no-<prot>-method
  468. As for no-<prot> but in addition do not build the methods for
  469. applications to explicitly select individual protocol
  470. versions. Note that there is no "no-tls1_3-method" option
  471. because there is no application method for TLSv1.3. Using
  472. individual protocol methods directly is deprecated.
  473. Applications should use TLS_method() instead.
  474. enable-<alg>
  475. Build with support for the specified algorithm, where <alg>
  476. is one of: md2 or rc5.
  477. no-<alg>
  478. Build without support for the specified algorithm, where
  479. <alg> is one of: aria, bf, blake2, camellia, cast, chacha,
  480. cmac, des, dh, dsa, ecdh, ecdsa, idea, md4, mdc2, ocb,
  481. poly1305, rc2, rc4, rmd160, scrypt, seed, siphash, siv, sm2,
  482. sm3, sm4 or whirlpool. The "ripemd" algorithm is deprecated
  483. and if used is synonymous with rmd160.
  484. -Dxxx, -Ixxx, -Wp, -lxxx, -Lxxx, -Wl, -rpath, -R, -framework, -static
  485. These system specific options will be recognised and
  486. passed through to the compiler to allow you to define
  487. preprocessor symbols, specify additional libraries, library
  488. directories or other compiler options. It might be worth
  489. noting that some compilers generate code specifically for
  490. processor the compiler currently executes on. This is not
  491. necessarily what you might have in mind, since it might be
  492. unsuitable for execution on other, typically older,
  493. processor. Consult your compiler documentation.
  494. Take note of the VAR=value documentation below and how
  495. these flags interact with those variables.
  496. -xxx, +xxx
  497. Additional options that are not otherwise recognised are
  498. passed through as they are to the compiler as well. Again,
  499. consult your compiler documentation.
  500. Take note of the VAR=value documentation below and how
  501. these flags interact with those variables.
  502. VAR=value
  503. Assignment of environment variable for Configure. These
  504. work just like normal environment variable assignments,
  505. but are supported on all platforms and are confined to
  506. the configuration scripts only. These assignments override
  507. the corresponding value in the inherited environment, if
  508. there is one.
  509. The following variables are used as "make variables" and
  510. can be used as an alternative to giving preprocessor,
  511. compiler and linker options directly as configuration.
  512. The following variables are supported:
  513. AR The static library archiver.
  514. ARFLAGS Flags for the static library archiver.
  515. AS The assembler compiler.
  516. ASFLAGS Flags for the assembler compiler.
  517. CC The C compiler.
  518. CFLAGS Flags for the C compiler.
  519. CXX The C++ compiler.
  520. CXXFLAGS Flags for the C++ compiler.
  521. CPP The C/C++ preprocessor.
  522. CPPFLAGS Flags for the C/C++ preprocessor.
  523. CPPDEFINES List of CPP macro definitions, separated
  524. by a platform specific character (':' or
  525. space for Unix, ';' for Windows, ',' for
  526. VMS). This can be used instead of using
  527. -D (or what corresponds to that on your
  528. compiler) in CPPFLAGS.
  529. CPPINCLUDES List of CPP inclusion directories, separated
  530. the same way as for CPPDEFINES. This can
  531. be used instead of -I (or what corresponds
  532. to that on your compiler) in CPPFLAGS.
  533. HASHBANGPERL Perl invocation to be inserted after '#!'
  534. in public perl scripts (only relevant on
  535. Unix).
  536. LD The program linker (not used on Unix, $(CC)
  537. is used there).
  538. LDFLAGS Flags for the shared library, DSO and
  539. program linker.
  540. LDLIBS Extra libraries to use when linking.
  541. Takes the form of a space separated list
  542. of library specifications on Unix and
  543. Windows, and as a comma separated list of
  544. libraries on VMS.
  545. RANLIB The library archive indexer.
  546. RC The Windows resource compiler.
  547. RCFLAGS Flags for the Windows resource compiler.
  548. RM The command to remove files and directories.
  549. These cannot be mixed with compiling / linking flags given
  550. on the command line. In other words, something like this
  551. isn't permitted.
  552. ./config -DFOO CPPFLAGS=-DBAR -DCOOKIE
  553. Backward compatibility note:
  554. To be compatible with older configuration scripts, the
  555. environment variables are ignored if compiling / linking
  556. flags are given on the command line, except for these:
  557. AR, CC, CXX, CROSS_COMPILE, HASHBANGPERL, PERL, RANLIB, RC
  558. and WINDRES
  559. For example, the following command will not see -DBAR:
  560. CPPFLAGS=-DBAR ./config -DCOOKIE
  561. However, the following will see both set variables:
  562. CC=gcc CROSS_COMPILE=x86_64-w64-mingw32- \
  563. ./config -DCOOKIE
  564. If CC is set, it is advisable to also set CXX to ensure
  565. both C and C++ compilers are in the same "family". This
  566. becomes relevant with 'enable-external-tests' and
  567. 'enable-buildtest-c++'.
  568. reconf
  569. reconfigure
  570. Reconfigure from earlier data. This fetches the previous
  571. command line options and environment from data saved in
  572. "configdata.pm", and runs the configuration process again,
  573. using these options and environment.
  574. Note: NO other option is permitted together with "reconf".
  575. This means that you also MUST use "./Configure" (or
  576. what corresponds to that on non-Unix platforms) directly
  577. to invoke this option.
  578. Note: The original configuration saves away values for ALL
  579. environment variables that were used, and if they weren't
  580. defined, they are still saved away with information that
  581. they weren't originally defined. This information takes
  582. precedence over environment variables that are defined
  583. when reconfiguring.
  584. Displaying configuration data
  585. -----------------------------
  586. The configuration script itself will say very little, and finishes by
  587. creating "configdata.pm". This perl module can be loaded by other scripts
  588. to find all the configuration data, and it can also be used as a script to
  589. display all sorts of configuration data in a human readable form.
  590. For more information, please do:
  591. $ ./configdata.pm --help # Unix
  592. or
  593. $ perl configdata.pm --help # Windows and VMS
  594. Installation in Detail
  595. ----------------------
  596. 1a. Configure OpenSSL for your operation system automatically:
  597. NOTE: This is not available on Windows.
  598. $ ./config [[ options ]] # Unix
  599. or
  600. $ @config [[ options ]] ! OpenVMS
  601. For the remainder of this text, the Unix form will be used in all
  602. examples, please use the appropriate form for your platform.
  603. This guesses at your operating system (and compiler, if necessary) and
  604. configures OpenSSL based on this guess. Run ./config -t to see
  605. if it guessed correctly. If you want to use a different compiler, you
  606. are cross-compiling for another platform, or the ./config guess was
  607. wrong for other reasons, go to step 1b. Otherwise go to step 2.
  608. On some systems, you can include debugging information as follows:
  609. $ ./config -d [[ options ]]
  610. 1b. Configure OpenSSL for your operating system manually
  611. OpenSSL knows about a range of different operating system, hardware and
  612. compiler combinations. To see the ones it knows about, run
  613. $ ./Configure # Unix
  614. or
  615. $ perl Configure # All other platforms
  616. For the remainder of this text, the Unix form will be used in all
  617. examples, please use the appropriate form for your platform.
  618. Pick a suitable name from the list that matches your system. For most
  619. operating systems there is a choice between using "cc" or "gcc". When
  620. you have identified your system (and if necessary compiler) use this name
  621. as the argument to Configure. For example, a "linux-elf" user would
  622. run:
  623. $ ./Configure linux-elf [[ options ]]
  624. If your system isn't listed, you will have to create a configuration
  625. file named Configurations/{{ something }}.conf and add the correct
  626. configuration for your system. See the available configs as examples
  627. and read Configurations/README and Configurations/README.design for
  628. more information.
  629. The generic configurations "cc" or "gcc" should usually work on 32 bit
  630. Unix-like systems.
  631. Configure creates a build file ("Makefile" on Unix, "makefile" on Windows
  632. and "descrip.mms" on OpenVMS) from a suitable template in Configurations,
  633. and defines various macros in include/openssl/opensslconf.h (generated from
  634. include/openssl/opensslconf.h.in).
  635. 1c. Configure OpenSSL for building outside of the source tree.
  636. OpenSSL can be configured to build in a build directory separate from
  637. the directory with the source code. It's done by placing yourself in
  638. some other directory and invoking the configuration commands from
  639. there.
  640. Unix example:
  641. $ mkdir /var/tmp/openssl-build
  642. $ cd /var/tmp/openssl-build
  643. $ /PATH/TO/OPENSSL/SOURCE/config [[ options ]]
  644. or
  645. $ /PATH/TO/OPENSSL/SOURCE/Configure {{ target }} [[ options ]]
  646. OpenVMS example:
  647. $ set default sys$login:
  648. $ create/dir [.tmp.openssl-build]
  649. $ set default [.tmp.openssl-build]
  650. $ @[PATH.TO.OPENSSL.SOURCE]config [[ options ]]
  651. or
  652. $ @[PATH.TO.OPENSSL.SOURCE]Configure {{ target }} [[ options ]]
  653. Windows example:
  654. $ C:
  655. $ mkdir \temp-openssl
  656. $ cd \temp-openssl
  657. $ perl d:\PATH\TO\OPENSSL\SOURCE\Configure {{ target }} [[ options ]]
  658. Paths can be relative just as well as absolute. Configure will
  659. do its best to translate them to relative paths whenever possible.
  660. 2. Build OpenSSL by running:
  661. $ make # Unix
  662. $ mms ! (or mmk) OpenVMS
  663. $ nmake # Windows
  664. This will build the OpenSSL libraries (libcrypto.a and libssl.a on
  665. Unix, corresponding on other platforms) and the OpenSSL binary
  666. ("openssl"). The libraries will be built in the top-level directory,
  667. and the binary will be in the "apps" subdirectory.
  668. Troubleshooting:
  669. If the build fails, look at the output. There may be reasons
  670. for the failure that aren't problems in OpenSSL itself (like
  671. missing standard headers).
  672. If the build succeeded previously, but fails after a source or
  673. configuration change, it might be helpful to clean the build tree
  674. before attempting another build. Use this command:
  675. $ make clean # Unix
  676. $ mms clean ! (or mmk) OpenVMS
  677. $ nmake clean # Windows
  678. Assembler error messages can sometimes be sidestepped by using the
  679. "no-asm" configuration option.
  680. Compiling parts of OpenSSL with gcc and others with the system
  681. compiler will result in unresolved symbols on some systems.
  682. If you are still having problems you can get help by sending an email
  683. to the openssl-users email list (see
  684. https://www.openssl.org/community/mailinglists.html for details). If
  685. it is a bug with OpenSSL itself, please open an issue on GitHub, at
  686. https://github.com/openssl/openssl/issues. Please review the existing
  687. ones first; maybe the bug was already reported or has already been
  688. fixed.
  689. 3. After a successful build, the libraries should be tested. Run:
  690. $ make test # Unix
  691. $ mms test ! OpenVMS
  692. $ nmake test # Windows
  693. NOTE: you MUST run the tests from an unprivileged account (or
  694. disable your privileges temporarily if your platform allows it).
  695. If some tests fail, look at the output. There may be reasons for
  696. the failure that isn't a problem in OpenSSL itself (like a
  697. malfunction with Perl). You may want increased verbosity, that
  698. can be accomplished like this:
  699. $ make VERBOSE=1 test # Unix
  700. $ mms /macro=(VERBOSE=1) test ! OpenVMS
  701. $ nmake VERBOSE=1 test # Windows
  702. If you want to run just one or a few specific tests, you can use
  703. the make variable TESTS to specify them, like this:
  704. $ make TESTS='test_rsa test_dsa' test # Unix
  705. $ mms/macro="TESTS=test_rsa test_dsa" test ! OpenVMS
  706. $ nmake TESTS='test_rsa test_dsa' test # Windows
  707. And of course, you can combine (Unix example shown):
  708. $ make VERBOSE=1 TESTS='test_rsa test_dsa' test
  709. You can find the list of available tests like this:
  710. $ make list-tests # Unix
  711. $ mms list-tests ! OpenVMS
  712. $ nmake list-tests # Windows
  713. Have a look at the manual for the perl module Test::Harness to
  714. see what other HARNESS_* variables there are.
  715. If you find a problem with OpenSSL itself, try removing any
  716. compiler optimization flags from the CFLAGS line in Makefile and
  717. run "make clean; make" or corresponding.
  718. To report a bug please open an issue on GitHub, at
  719. https://github.com/openssl/openssl/issues.
  720. For more details on how the make variables TESTS can be used,
  721. see section TESTS in Detail below.
  722. 4. If everything tests ok, install OpenSSL with
  723. $ make install # Unix
  724. $ mms install ! OpenVMS
  725. $ nmake install # Windows
  726. This will install all the software components in this directory
  727. tree under PREFIX (the directory given with --prefix or its
  728. default):
  729. Unix:
  730. bin/ Contains the openssl binary and a few other
  731. utility scripts.
  732. include/openssl
  733. Contains the header files needed if you want
  734. to build your own programs that use libcrypto
  735. or libssl.
  736. lib Contains the OpenSSL library files.
  737. lib/engines Contains the OpenSSL dynamically loadable engines.
  738. share/man/man1 Contains the OpenSSL command line man-pages.
  739. share/man/man3 Contains the OpenSSL library calls man-pages.
  740. share/man/man5 Contains the OpenSSL configuration format man-pages.
  741. share/man/man7 Contains the OpenSSL other misc man-pages.
  742. share/doc/openssl/html/man1
  743. share/doc/openssl/html/man3
  744. share/doc/openssl/html/man5
  745. share/doc/openssl/html/man7
  746. Contains the HTML rendition of the man-pages.
  747. OpenVMS ('arch' is replaced with the architecture name, "Alpha"
  748. or "ia64", 'sover' is replaced with the shared library version
  749. (0101 for 1.1), and 'pz' is replaced with the pointer size
  750. OpenSSL was built with):
  751. [.EXE.'arch'] Contains the openssl binary.
  752. [.EXE] Contains a few utility scripts.
  753. [.include.openssl]
  754. Contains the header files needed if you want
  755. to build your own programs that use libcrypto
  756. or libssl.
  757. [.LIB.'arch'] Contains the OpenSSL library files.
  758. [.ENGINES'sover''pz'.'arch']
  759. Contains the OpenSSL dynamically loadable engines.
  760. [.SYS$STARTUP] Contains startup, login and shutdown scripts.
  761. These define appropriate logical names and
  762. command symbols.
  763. [.SYSTEST] Contains the installation verification procedure.
  764. [.HTML] Contains the HTML rendition of the manual pages.
  765. Additionally, install will add the following directories under
  766. OPENSSLDIR (the directory given with --openssldir or its default)
  767. for you convenience:
  768. certs Initially empty, this is the default location
  769. for certificate files.
  770. private Initially empty, this is the default location
  771. for private key files.
  772. misc Various scripts.
  773. Package builders who want to configure the library for standard
  774. locations, but have the package installed somewhere else so that
  775. it can easily be packaged, can use
  776. $ make DESTDIR=/tmp/package-root install # Unix
  777. $ mms/macro="DESTDIR=TMP:[PACKAGE-ROOT]" install ! OpenVMS
  778. The specified destination directory will be prepended to all
  779. installation target paths.
  780. Compatibility issues with previous OpenSSL versions:
  781. * COMPILING existing applications
  782. Starting with version 1.1.0, OpenSSL hides a number of structures
  783. that were previously open. This includes all internal libssl
  784. structures and a number of EVP types. Accessor functions have
  785. been added to allow controlled access to the structures' data.
  786. This means that some software needs to be rewritten to adapt to
  787. the new ways of doing things. This often amounts to allocating
  788. an instance of a structure explicitly where you could previously
  789. allocate them on the stack as automatic variables, and using the
  790. provided accessor functions where you would previously access a
  791. structure's field directly.
  792. Some APIs have changed as well. However, older APIs have been
  793. preserved when possible.
  794. Environment Variables
  795. ---------------------
  796. A number of environment variables can be used to provide additional control
  797. over the build process. Typically these should be defined prior to running
  798. config or Configure. Not all environment variables are relevant to all
  799. platforms.
  800. AR
  801. The name of the ar executable to use.
  802. BUILDFILE
  803. Use a different build file name than the platform default
  804. ("Makefile" on Unix-like platforms, "makefile" on native Windows,
  805. "descrip.mms" on OpenVMS). This requires that there is a
  806. corresponding build file template. See Configurations/README
  807. for further information.
  808. CC
  809. The compiler to use. Configure will attempt to pick a default
  810. compiler for your platform but this choice can be overridden
  811. using this variable. Set it to the compiler executable you wish
  812. to use, e.g. "gcc" or "clang".
  813. CROSS_COMPILE
  814. This environment variable has the same meaning as for the
  815. "--cross-compile-prefix" Configure flag described above. If both
  816. are set then the Configure flag takes precedence.
  817. NM
  818. The name of the nm executable to use.
  819. OPENSSL_LOCAL_CONFIG_DIR
  820. OpenSSL comes with a database of information about how it
  821. should be built on different platforms as well as build file
  822. templates for those platforms. The database is comprised of
  823. ".conf" files in the Configurations directory. The build
  824. file templates reside there as well as ".tmpl" files. See the
  825. file Configurations/README for further information about the
  826. format of ".conf" files as well as information on the ".tmpl"
  827. files.
  828. In addition to the standard ".conf" and ".tmpl" files, it is
  829. possible to create your own ".conf" and ".tmpl" files and store
  830. them locally, outside the OpenSSL source tree. This environment
  831. variable can be set to the directory where these files are held
  832. and will be considered by Configure before it looks in the
  833. standard directories.
  834. PERL
  835. The name of the Perl executable to use when building OpenSSL.
  836. This variable is used in config script only. Configure on the
  837. other hand imposes the interpreter by which it itself was
  838. executed on the whole build procedure.
  839. HASHBANGPERL
  840. The command string for the Perl executable to insert in the
  841. #! line of perl scripts that will be publically installed.
  842. Default: /usr/bin/env perl
  843. Note: the value of this variable is added to the same scripts
  844. on all platforms, but it's only relevant on Unix-like platforms.
  845. RC
  846. The name of the rc executable to use. The default will be as
  847. defined for the target platform in the ".conf" file. If not
  848. defined then "windres" will be used. The WINDRES environment
  849. variable is synonymous to this. If both are defined then RC
  850. takes precedence.
  851. RANLIB
  852. The name of the ranlib executable to use.
  853. WINDRES
  854. See RC.
  855. Makefile targets
  856. ----------------
  857. The Configure script generates a Makefile in a format relevant to the specific
  858. platform. The Makefiles provide a number of targets that can be used. Not all
  859. targets may be available on all platforms. Only the most common targets are
  860. described here. Examine the Makefiles themselves for the full list.
  861. all
  862. The default target to build all the software components.
  863. clean
  864. Remove all build artefacts and return the directory to a "clean"
  865. state.
  866. depend
  867. Rebuild the dependencies in the Makefiles. This is a legacy
  868. option that no longer needs to be used since OpenSSL 1.1.0.
  869. install
  870. Install all OpenSSL components.
  871. install_sw
  872. Only install the OpenSSL software components.
  873. install_docs
  874. Only install the OpenSSL documentation components.
  875. install_man_docs
  876. Only install the OpenSSL man pages (Unix only).
  877. install_html_docs
  878. Only install the OpenSSL html documentation.
  879. list-tests
  880. Prints a list of all the self test names.
  881. test
  882. Build and run the OpenSSL self tests.
  883. uninstall
  884. Uninstall all OpenSSL components.
  885. reconfigure
  886. reconf
  887. Re-run the configuration process, as exactly as the last time
  888. as possible.
  889. update
  890. This is a developer option. If you are developing a patch for
  891. OpenSSL you may need to use this if you want to update
  892. automatically generated files; add new error codes or add new
  893. (or change the visibility of) public API functions. (Unix only).
  894. TESTS in Detail
  895. ---------------
  896. The make variable TESTS supports a versatile set of space separated tokens
  897. with which you can specify a set of tests to be performed. With a "current
  898. set of tests" in mind, initially being empty, here are the possible tokens:
  899. alltests The current set of tests becomes the whole set of available
  900. tests (as listed when you do 'make list-tests' or similar).
  901. xxx Adds the test 'xxx' to the current set of tests.
  902. -xxx Removes 'xxx' from the current set of tests. If this is the
  903. first token in the list, the current set of tests is first
  904. assigned the whole set of available tests, effectively making
  905. this token equivalent to TESTS="alltests -xxx".
  906. nn Adds the test group 'nn' (which is a number) to the current
  907. set of tests.
  908. -nn Removes the test group 'nn' from the current set of tests.
  909. If this is the first token in the list, the current set of
  910. tests is first assigned the whole set of available tests,
  911. effectively making this token equivalent to
  912. TESTS="alltests -xxx".
  913. Also, all tokens except for "alltests" may have wildcards, such as *.
  914. (on Unix and Windows, BSD style wildcards are supported, while on VMS,
  915. it's VMS style wildcards)
  916. Example: All tests except for the fuzz tests:
  917. $ make TESTS=-test_fuzz test
  918. or (if you want to be explicit)
  919. $ make TESTS='alltests -test_fuzz' test
  920. Example: All tests that have a name starting with "test_ssl" but not those
  921. starting with "test_ssl_":
  922. $ make TESTS='test_ssl* -test_ssl_*' test
  923. Example: Only test group 10:
  924. $ make TESTS='10'
  925. Example: All tests except the slow group (group 99):
  926. $ make TESTS='-99'
  927. Example: All tests in test groups 80 to 99 except for tests in group 90:
  928. $ make TESTS='[89]? -90'
  929. Note on multi-threading
  930. -----------------------
  931. For some systems, the OpenSSL Configure script knows what compiler options
  932. are needed to generate a library that is suitable for multi-threaded
  933. applications. On these systems, support for multi-threading is enabled
  934. by default; use the "no-threads" option to disable (this should never be
  935. necessary).
  936. On other systems, to enable support for multi-threading, you will have
  937. to specify at least two options: "threads", and a system-dependent option.
  938. (The latter is "-D_REENTRANT" on various systems.) The default in this
  939. case, obviously, is not to include support for multi-threading (but
  940. you can still use "no-threads" to suppress an annoying warning message
  941. from the Configure script.)
  942. OpenSSL provides built-in support for two threading models: pthreads (found on
  943. most UNIX/Linux systems), and Windows threads. No other threading models are
  944. supported. If your platform does not provide pthreads or Windows threads then
  945. you should Configure with the "no-threads" option.
  946. Notes on shared libraries
  947. -------------------------
  948. For most systems the OpenSSL Configure script knows what is needed to
  949. build shared libraries for libcrypto and libssl. On these systems
  950. the shared libraries will be created by default. This can be suppressed and
  951. only static libraries created by using the "no-shared" option. On systems
  952. where OpenSSL does not know how to build shared libraries the "no-shared"
  953. option will be forced and only static libraries will be created.
  954. Shared libraries are named a little differently on different platforms.
  955. One way or another, they all have the major OpenSSL version number as
  956. part of the file name, i.e. for OpenSSL 1.1.x, 1.1 is somehow part of
  957. the name.
  958. On most POSIX platforms, shared libraries are named libcrypto.so.1.1
  959. and libssl.so.1.1.
  960. on Cygwin, shared libraries are named cygcrypto-1.1.dll and cygssl-1.1.dll
  961. with import libraries libcrypto.dll.a and libssl.dll.a.
  962. On Windows build with MSVC or using MingW, shared libraries are named
  963. libcrypto-1_1.dll and libssl-1_1.dll for 32-bit Windows, libcrypto-1_1-x64.dll
  964. and libssl-1_1-x64.dll for 64-bit x86_64 Windows, and libcrypto-1_1-ia64.dll
  965. and libssl-1_1-ia64.dll for IA64 Windows. With MSVC, the import libraries
  966. are named libcrypto.lib and libssl.lib, while with MingW, they are named
  967. libcrypto.dll.a and libssl.dll.a.
  968. On VMS, shareable images (VMS speak for shared libraries) are named
  969. ossl$libcrypto0101_shr.exe and ossl$libssl0101_shr.exe. However, when
  970. OpenSSL is specifically built for 32-bit pointers, the shareable images
  971. are named ossl$libcrypto0101_shr32.exe and ossl$libssl0101_shr32.exe
  972. instead, and when built for 64-bit pointers, they are named
  973. ossl$libcrypto0101_shr64.exe and ossl$libssl0101_shr64.exe.
  974. Note on random number generation
  975. --------------------------------
  976. Availability of cryptographically secure random numbers is required for
  977. secret key generation. OpenSSL provides several options to seed the
  978. internal CSPRNG. If not properly seeded, the internal CSPRNG will refuse
  979. to deliver random bytes and a "PRNG not seeded error" will occur.
  980. The seeding method can be configured using the --with-rand-seed option,
  981. which can be used to specify a comma separated list of seed methods.
  982. However in most cases OpenSSL will choose a suitable default method,
  983. so it is not necessary to explicitly provide this option. Note also
  984. that not all methods are available on all platforms.
  985. I) On operating systems which provide a suitable randomness source (in
  986. form of a system call or system device), OpenSSL will use the optimal
  987. available method to seed the CSPRNG from the operating system's
  988. randomness sources. This corresponds to the option --with-rand-seed=os.
  989. II) On systems without such a suitable randomness source, automatic seeding
  990. and reseeding is disabled (--with-rand-seed=none) and it may be necessary
  991. to install additional support software to obtain a random seed and reseed
  992. the CSPRNG manually. Please check out the manual pages for RAND_add(),
  993. RAND_bytes(), RAND_egd(), and the FAQ for more information.