summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorStevenWdV <stevenwdv@gmail.com>2022-01-24 14:59:25 +0100
committerStevenWdV <stevenwdv@gmail.com>2022-01-24 16:24:57 +0100
commite544c6fa9e15e7277da79e2464243e90b2706b8c (patch)
treede6613747e0e34a799089d4677f9833a85748712 /README.md
parentaab2e4b966c82b67eb0e204060e5ea6cd4ea15cf (diff)
Cleanup
Added variables to Makefiles to specify custom exports/ directory; Split exception classes in Java & C#; Added more comments; Renamed library and Go package; Removed real (pure) tests; Added generate_lib.ps1 to generate import .lib for Windows (Swift); Moved built Go libraries to exports/lib/; Switch to hopefully faster Swift GitHub Action.
Diffstat (limited to 'README.md')
-rw-r--r--README.md47
1 files changed, 34 insertions, 13 deletions
diff --git a/README.md b/README.md
index 4919bef..268cb76 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
This repository contains a Go library with functions that all EduVPN clients can use. The goal is to let EduVPN clients
link against this library and gradually merge more common logic between EduVPN clients into this repository.
-cgo is used to build the go library into a shared dynamic library. Wrappers will be written using some FFI framework for
+cgo is used to build the Go library into a shared dynamic library. Wrappers will be written using some FFI framework for
each language used in EduVPN clients to easily interface with the library.
## Functionality
@@ -15,7 +15,7 @@ be downloaded by the caller.
To run the Go tests, you will need [Go](https://go.dev/doc/install) 1.15 or later (add it to your `PATH`). To build the
shared library, you will additionally need to install gcc. If you want to use the Makefile scripts you will need GNU
-make.
+make (not bsd make).
On Windows, you can install gcc and make (or even Go) via MinGW or Cygwin or use WSL. For MinGW:
@@ -25,15 +25,16 @@ On Windows, you can install gcc and make (or even Go) via MinGW or Cygwin or use
e.g. [`mingw-w64-x86_64-make`](https://packages.msys2.org/package/mingw-w64-x86_64-make?repo=mingw64) and
use `mingw32-make` in the command line)
3. To compile for x86_64:
- 1. Install the [`mingw-w64-x86_64-gcc`](https://packages.msys2.org/package/mingw-w64-x86_64-gcc?repo=mingw64) package
- 2. Open the MinGW 64-bit console, via the start menu, or in your current
- terminal: `path/to/msys64/msys2_shell.cmd -mingw64 -defterm -no-start -use-full-path`
- 3. Run the make commands in the project directory
+ 1. Install the [`mingw-w64-x86_64-gcc`](https://packages.msys2.org/package/mingw-w64-x86_64-gcc?repo=mingw64)
+ package
+ 2. Open the MinGW 64-bit console, via the start menu, or in your current
+ terminal: `path/to/msys64/msys2_shell.cmd -mingw64 -defterm -no-start -use-full-path`
+ 3. Run the make commands in the project directory
4. To compile for x86 (32-bit):
- 1. Install the [`mingw-w64-i686-gcc`](https://packages.msys2.org/package/mingw-w64-i686-gcc?repo=mingw32) package
- 2. Open the MinGW 32-bit console, via the start menu, or in your current
- terminal: `path/to/msys64/msys2_shell.cmd -mingw32 -defterm -no-start -use-full-path`
- 3. Run the make commands in the project directory
+ 1. Install the [`mingw-w64-i686-gcc`](https://packages.msys2.org/package/mingw-w64-i686-gcc?repo=mingw32) package
+ 2. Open the MinGW 32-bit console, via the start menu, or in your current
+ terminal: `path/to/msys64/msys2_shell.cmd -mingw32 -defterm -no-start -use-full-path`
+ 3. Run the make commands in the project directory
Take a look at `wrappers/<lang>/README.md` for extra instructions for each wrapper.
@@ -51,9 +52,15 @@ Build shared library for specified OS & architecture (example):
make GOOS=windows GOARCH=386
```
-Results will be output in `exports/`.
+Results will be output in `exports/lib/`.
-TODO: notes on cross-compilation
+Usually you will need to specify the compiler when cross compiling, for example:
+
+```shell
+make GOOS=windows GOARCH=amd64 CC=x86_64-w64-mingw32-gcc
+```
+
+For example, you can cross compile for Windows from Linux using [MinGW-w64](https://www.mingw-w64.org/downloads/).
Test Go code:
@@ -67,9 +74,23 @@ Test wrappers (you will need compilers for all wrappers if you do this):
make test-wrappers
```
+Specify `-j` to execute tests in parallel.
+
+Test both:
+
+```shell
+make test
+```
+
+Clean built libraries and wrapper builds:
+
+```shell
+make clean -j
+```
+
Take a look at `wrappers/<lang>/README.md` for descriptions per wrapper.
-## Directory
+## Structure
- `verify.go`: main API
- `verify_test.go` and `test_data/`: tests for API