INSTALL 53 KB

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