aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Andersen <csandersen3@gmail.com>2024-04-09 22:14:04 +0200
committerChristian Andersen <csandersen3@gmail.com>2024-05-25 12:43:01 +0200
commit937a3d920ead4c5a8bff162bbc719f39208988ee (patch)
treeef4f717b14198ba32d6b4ac702be186f2fdd933c
parentad6e77ca9fe3da77a23b6b89e9678c92663c9cc8 (diff)
downloadportable-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.md96
-rw-r--r--README.mingw.md16
2 files changed, 52 insertions, 60 deletions
diff --git a/README.md b/README.md
index 9c07175..b4fff87 100644
--- a/README.md
+++ b/README.md
@@ -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
54Official release tarballs are available at your friendly neighborhood 54Official release tarballs are available at your friendly neighborhood
55OpenBSD mirror in directory 55OpenBSD 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
73If you have checked this source using Git, or have downloaded a source tarball 73If you have checked out this source using Git, or have downloaded a source
74from GitHub, follow these initial steps to prepare the source tree for 74tarball from GitHub, follow these initial steps to prepare the source tree for
75building. _Note: Your build will fail if you do not follow these instructions! 75building. _Note: Your build will fail if you do not follow these instructions!
76If you cannot follow these instructions (e.g. Windows system using CMake) or 76If you cannot follow these instructions or cannot meet these prerequisites,
77cannot meet these prerequistes, please download an official release distribution 77please download an official release distribution from
78from https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/ instead. Using official 78https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/ instead. Using official
79releases is strongly advised if you are not a developer._ 79releases is strongly advised if you are not a developer._
80 80
811. Ensure you have the following packages installed: 811. Ensure that you have a bash shell. This is also required on Windows.
82 automake, autoconf, git, libtool, perl 822. Ensure that you have the following packages installed:
832. 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. 843. 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
88Once you have a source tree, either by downloaded using git and having 88Once you have the source tree prepared, run these commands to build and install:
89run the `autogen.sh` script above, or by downloading a release distribution from
90an OpenBSD mirror, run these commands to build and install the package on most
91systems:
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
96make install # set DESTDIR= to install to an alternate location 93make install # set DESTDIR= to install to an alternate location
97``` 94```
98 95
99If you wish to use the CMake build system, use these commands: 96Alternatively, it is possible to run `./dist.sh` to prepare a tarball.
97
98## Build steps using CMake
99
100Once you have the source tree prepared, run these commands to build and install:
100 101
101```sh 102```sh
102mkdir build 103mkdir build
@@ -106,7 +107,7 @@ make
106make test 107make test
107``` 108```
108 109
109For faster builds, you can use Ninja as well: 110For faster builds, you can use Ninja:
110 111
111```sh 112```sh
112mkdir build-ninja 113mkdir build-ninja
@@ -116,44 +117,15 @@ ninja
116ninja test 117ninja test
117``` 118```
118 119
119### OS specific build information 120Or another supported build system like Visual Studio:
120
121#### HP-UX (11i)
122
123Set the UNIX_STD environment variable to `2003` before running `configure`
124in order to build with the HP C/aC++ compiler. See the "standards(5)" man
125page for more details.
126
127```sh
128export UNIX_STD=2003
129./configure
130make
131```
132
133#### Windows - Mingw-w64
134
135LibreSSL builds against relatively recent versions of Mingw-w64, not to be
136confused with the original mingw.org project. Mingw-w64 3.2 or later
137should work. See README.mingw.md for more information.
138
139#### Windows - Visual Studio
140
141LibreSSL builds using the CMake target "Visual Studio 12 2013" and newer. To
142generate a Visual Studio project, install CMake, enter the LibreSSL source
143directory and run:
144 121
145```sh 122```sh
146./update.sh 123mkdir build-vs2022
147mkdir build-vs2013 124cd build-vs2022
148cd build-vs2013 125cmake -G"Visual Studio 17 2022" ..
149cmake -G"Visual Studio 12 2013" ..
150``` 126```
151 127
152Replace "Visual Studio 12 2013" with whatever version of Visual Studio you 128#### Additional CMake Options
153have installed. This will generate a LibreSSL.sln file that you can incorporate
154into 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
145Set the UNIX_STD environment variable to `2003` before running `configure`
146in order to build with the HP C/aC++ compiler. See the "standards(5)" man
147page for more details.
148
149```sh
150export UNIX_STD=2003
151./configure
152make
153```
154
155### MinGW-w64 - Windows
156
157LibreSSL builds against relatively recent versions of [MinGW-w64](https://www.mingw-w64.org/), not to be
158confused with the original mingw.org project. MinGW-w64 3.2 or later
159should 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
3For Windows systems, LibreSSL supports the mingw-w64 toolchain, which can use 3For Windows systems, LibreSSL supports the MinGW-w64 toolchain, which can use
4GCC or Clang as the compiler. Contrary to its name, mingw-w64 supports both 4GCC or Clang as the compiler. Contrary to its name, MinGW-w64 supports both
532-bit and 64-bit build environments. If your project already uses mingw-w64, 532-bit and 64-bit build environments. If your project already uses MinGW-w64,
6then LibreSSL should integrate very nicely. Old versions of the mingw-w64 6then LibreSSL should integrate very nicely. Old versions of the MinGW-w64
7toolchain, such as the one packaged with Ubuntu 12.04, may have trouble 7toolchain, such as the one packaged with Ubuntu 12.04, may have trouble
8building LibreSSL. Please try it with a recent toolchain if you encounter 8building LibreSSL. Please try it with a recent toolchain if you encounter
9troubles. Cygwin provides an easy method of installing the latest mingw-w64 9troubles. Cygwin provides an easy method of installing the latest MinGW-w64
10cross compilers on Windows. 10cross-compilers on Windows.
11 11
12To configure and build LibreSSL for a 32-bit system, use the following 12To configure and build LibreSSL for a 32-bit system, use the following
13build steps: 13build steps:
@@ -36,7 +36,7 @@ expiry date is set past 19 January 2038, it will be unable to tell if the
36certificate has expired or not, and thus take the safe stance and reject it. 36certificate has expired or not, and thus take the safe stance and reject it.
37 37
38In order to avoid this, you need to build LibreSSL (and everything that links 38In order to avoid this, you need to build LibreSSL (and everything that links
39with it) with the -D__MINGW_USE_VC2005_COMPAT flag. This tells mingw-w64 to 39with it) with the -D__MINGW_USE_VC2005_COMPAT flag. This tells MinGW-w64 to
40use the new ABI. 40use the new ABI.
41 41
4264-bit systems always have a 64-bit time_t and are not affected by this 4264-bit systems always have a 64-bit time_t and are not affected by this