diff options
author | Christian Andersen <csandersen3@gmail.com> | 2024-04-09 22:14:04 +0200 |
---|---|---|
committer | Christian Andersen <csandersen3@gmail.com> | 2024-05-25 12:43:01 +0200 |
commit | 937a3d920ead4c5a8bff162bbc719f39208988ee (patch) | |
tree | ef4f717b14198ba32d6b4ac702be186f2fdd933c | |
parent | ad6e77ca9fe3da77a23b6b89e9678c92663c9cc8 (diff) | |
download | portable-937a3d920ead4c5a8bff162bbc719f39208988ee.tar.gz portable-937a3d920ead4c5a8bff162bbc719f39208988ee.tar.bz2 portable-937a3d920ead4c5a8bff162bbc719f39208988ee.zip |
Try to simplify build instruction.
In particular simplify the Windows build instructions,
by only having a short CMake section about it. While
mentioning that bash shell is required also on Windows
up-front.
Splits the build section into a section for configure
and one for CMake so it is easier to pick one of them.
Moves the additional CMake options into the CMake section.
Moves dist.sh text into the configure section as it is
configure specific.
-rw-r--r-- | README.md | 96 | ||||
-rw-r--r-- | README.mingw.md | 16 |
2 files changed, 52 insertions, 60 deletions
@@ -49,7 +49,7 @@ LibreSSL also supports the following Windows environments: | |||
49 | 49 | ||
50 | * Microsoft Windows (Windows 7 / Windows Server 2008r2 or later, x86 and x64) | 50 | * Microsoft Windows (Windows 7 / Windows Server 2008r2 or later, x86 and x64) |
51 | * Wine (32-bit and 64-bit) | 51 | * Wine (32-bit and 64-bit) |
52 | * Mingw-w64, Cygwin, and Visual Studio | 52 | * MinGW-w64, Cygwin, and Visual Studio |
53 | 53 | ||
54 | Official release tarballs are available at your friendly neighborhood | 54 | Official release tarballs are available at your friendly neighborhood |
55 | OpenBSD mirror in directory | 55 | OpenBSD mirror in directory |
@@ -68,27 +68,24 @@ sent to the core team at libressl-security@openbsd.org. | |||
68 | 68 | ||
69 | # Building LibreSSL | 69 | # Building LibreSSL |
70 | 70 | ||
71 | ## Prerequisites when building from a Git checkout | 71 | ## Building from a Git checkout |
72 | 72 | ||
73 | If you have checked this source using Git, or have downloaded a source tarball | 73 | If you have checked out this source using Git, or have downloaded a source |
74 | from GitHub, follow these initial steps to prepare the source tree for | 74 | tarball from GitHub, follow these initial steps to prepare the source tree for |
75 | building. _Note: Your build will fail if you do not follow these instructions! | 75 | building. _Note: Your build will fail if you do not follow these instructions! |
76 | If you cannot follow these instructions (e.g. Windows system using CMake) or | 76 | If you cannot follow these instructions or cannot meet these prerequisites, |
77 | cannot meet these prerequistes, please download an official release distribution | 77 | please download an official release distribution from |
78 | from https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/ instead. Using official | 78 | https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/ instead. Using official |
79 | releases is strongly advised if you are not a developer._ | 79 | releases is strongly advised if you are not a developer._ |
80 | 80 | ||
81 | 1. Ensure you have the following packages installed: | 81 | 1. Ensure that you have a bash shell. This is also required on Windows. |
82 | automake, autoconf, git, libtool, perl | 82 | 2. Ensure that you have the following packages installed: |
83 | 2. Run `./autogen.sh` to prepare the source tree for building or | 83 | automake, autoconf, git, libtool, perl. |
84 | run `./dist.sh` to prepare a tarball. | 84 | 3. Run `./autogen.sh` to prepare the source tree for building. |
85 | 85 | ||
86 | ## Steps that apply to all builds | 86 | ## Build steps using configure |
87 | 87 | ||
88 | Once you have a source tree, either by downloaded using git and having | 88 | Once you have the source tree prepared, run these commands to build and install: |
89 | run the `autogen.sh` script above, or by downloading a release distribution from | ||
90 | an OpenBSD mirror, run these commands to build and install the package on most | ||
91 | systems: | ||
92 | 89 | ||
93 | ```sh | 90 | ```sh |
94 | ./configure # see ./configure --help for configuration options | 91 | ./configure # see ./configure --help for configuration options |
@@ -96,7 +93,11 @@ make check # runs builtin unit tests | |||
96 | make install # set DESTDIR= to install to an alternate location | 93 | make install # set DESTDIR= to install to an alternate location |
97 | ``` | 94 | ``` |
98 | 95 | ||
99 | If you wish to use the CMake build system, use these commands: | 96 | Alternatively, it is possible to run `./dist.sh` to prepare a tarball. |
97 | |||
98 | ## Build steps using CMake | ||
99 | |||
100 | Once you have the source tree prepared, run these commands to build and install: | ||
100 | 101 | ||
101 | ```sh | 102 | ```sh |
102 | mkdir build | 103 | mkdir build |
@@ -106,7 +107,7 @@ make | |||
106 | make test | 107 | make test |
107 | ``` | 108 | ``` |
108 | 109 | ||
109 | For faster builds, you can use Ninja as well: | 110 | For faster builds, you can use Ninja: |
110 | 111 | ||
111 | ```sh | 112 | ```sh |
112 | mkdir build-ninja | 113 | mkdir build-ninja |
@@ -116,44 +117,15 @@ ninja | |||
116 | ninja test | 117 | ninja test |
117 | ``` | 118 | ``` |
118 | 119 | ||
119 | ### OS specific build information | 120 | Or another supported build system like Visual Studio: |
120 | |||
121 | #### HP-UX (11i) | ||
122 | |||
123 | Set the UNIX_STD environment variable to `2003` before running `configure` | ||
124 | in order to build with the HP C/aC++ compiler. See the "standards(5)" man | ||
125 | page for more details. | ||
126 | |||
127 | ```sh | ||
128 | export UNIX_STD=2003 | ||
129 | ./configure | ||
130 | make | ||
131 | ``` | ||
132 | |||
133 | #### Windows - Mingw-w64 | ||
134 | |||
135 | LibreSSL builds against relatively recent versions of Mingw-w64, not to be | ||
136 | confused with the original mingw.org project. Mingw-w64 3.2 or later | ||
137 | should work. See README.mingw.md for more information. | ||
138 | |||
139 | #### Windows - Visual Studio | ||
140 | |||
141 | LibreSSL builds using the CMake target "Visual Studio 12 2013" and newer. To | ||
142 | generate a Visual Studio project, install CMake, enter the LibreSSL source | ||
143 | directory and run: | ||
144 | 121 | ||
145 | ```sh | 122 | ```sh |
146 | ./update.sh | 123 | mkdir build-vs2022 |
147 | mkdir build-vs2013 | 124 | cd build-vs2022 |
148 | cd build-vs2013 | 125 | cmake -G"Visual Studio 17 2022" .. |
149 | cmake -G"Visual Studio 12 2013" .. | ||
150 | ``` | 126 | ``` |
151 | 127 | ||
152 | Replace "Visual Studio 12 2013" with whatever version of Visual Studio you | 128 | #### Additional CMake Options |
153 | have installed. This will generate a LibreSSL.sln file that you can incorporate | ||
154 | into other projects or build by itself. | ||
155 | |||
156 | #### CMake - Additional Options | ||
157 | 129 | ||
158 | | Option Name | Default | Description | | 130 | | Option Name | Default | Description | |
159 | |-------------------------|--------:|-----------------------------------------------------------------------------------------------------------------| | 131 | |-------------------------|--------:|-----------------------------------------------------------------------------------------------------------------| |
@@ -166,6 +138,26 @@ into other projects or build by itself. | |||
166 | | `ENABLE_NC` | `OFF` | Enable installing TLS-enabled nc(1) | | 138 | | `ENABLE_NC` | `OFF` | Enable installing TLS-enabled nc(1) | |
167 | | `OPENSSLDIR` | Blank | Set the default openssl directory. Can be specified from command line using <br>```-DOPENSSLDIR=<dirname>``` | | 139 | | `OPENSSLDIR` | Blank | Set the default openssl directory. Can be specified from command line using <br>```-DOPENSSLDIR=<dirname>``` | |
168 | 140 | ||
141 | ## Build information for specific systems | ||
142 | |||
143 | ### HP-UX (11i) | ||
144 | |||
145 | Set the UNIX_STD environment variable to `2003` before running `configure` | ||
146 | in order to build with the HP C/aC++ compiler. See the "standards(5)" man | ||
147 | page for more details. | ||
148 | |||
149 | ```sh | ||
150 | export UNIX_STD=2003 | ||
151 | ./configure | ||
152 | make | ||
153 | ``` | ||
154 | |||
155 | ### MinGW-w64 - Windows | ||
156 | |||
157 | LibreSSL builds against relatively recent versions of [MinGW-w64](https://www.mingw-w64.org/), not to be | ||
158 | confused with the original mingw.org project. MinGW-w64 3.2 or later | ||
159 | should work. See [README.mingw.md](README.mingw.md) for more information. | ||
160 | |||
169 | # Using LibreSSL | 161 | # Using LibreSSL |
170 | 162 | ||
171 | ## CMake | 163 | ## CMake |
diff --git a/README.mingw.md b/README.mingw.md index 7c567bc..a90de5f 100644 --- a/README.mingw.md +++ b/README.mingw.md | |||
@@ -1,13 +1,13 @@ | |||
1 | ## Building with mingw-w64 for 32- and 64-bit | 1 | ## Building with MinGW-w64 for 32- and 64-bit |
2 | 2 | ||
3 | For Windows systems, LibreSSL supports the mingw-w64 toolchain, which can use | 3 | For Windows systems, LibreSSL supports the MinGW-w64 toolchain, which can use |
4 | GCC or Clang as the compiler. Contrary to its name, mingw-w64 supports both | 4 | GCC or Clang as the compiler. Contrary to its name, MinGW-w64 supports both |
5 | 32-bit and 64-bit build environments. If your project already uses mingw-w64, | 5 | 32-bit and 64-bit build environments. If your project already uses MinGW-w64, |
6 | then LibreSSL should integrate very nicely. Old versions of the mingw-w64 | 6 | then LibreSSL should integrate very nicely. Old versions of the MinGW-w64 |
7 | toolchain, such as the one packaged with Ubuntu 12.04, may have trouble | 7 | toolchain, such as the one packaged with Ubuntu 12.04, may have trouble |
8 | building LibreSSL. Please try it with a recent toolchain if you encounter | 8 | building LibreSSL. Please try it with a recent toolchain if you encounter |
9 | troubles. Cygwin provides an easy method of installing the latest mingw-w64 | 9 | troubles. Cygwin provides an easy method of installing the latest MinGW-w64 |
10 | cross compilers on Windows. | 10 | cross-compilers on Windows. |
11 | 11 | ||
12 | To configure and build LibreSSL for a 32-bit system, use the following | 12 | To configure and build LibreSSL for a 32-bit system, use the following |
13 | build steps: | 13 | build steps: |
@@ -36,7 +36,7 @@ expiry date is set past 19 January 2038, it will be unable to tell if the | |||
36 | certificate has expired or not, and thus take the safe stance and reject it. | 36 | certificate has expired or not, and thus take the safe stance and reject it. |
37 | 37 | ||
38 | In order to avoid this, you need to build LibreSSL (and everything that links | 38 | In order to avoid this, you need to build LibreSSL (and everything that links |
39 | with it) with the -D__MINGW_USE_VC2005_COMPAT flag. This tells mingw-w64 to | 39 | with it) with the -D__MINGW_USE_VC2005_COMPAT flag. This tells MinGW-w64 to |
40 | use the new ABI. | 40 | use the new ABI. |
41 | 41 | ||
42 | 64-bit systems always have a 64-bit time_t and are not affected by this | 42 | 64-bit systems always have a 64-bit time_t and are not affected by this |