Browse Source

OpenBSD support

Tim Buktu 3 years ago
parent
commit
ad08c5ec89
3 changed files with 7 additions and 2 deletions
  1. 2 0
      Makefile
  2. 3 1
      Makefile.bsd
  3. 2 1
      README.md

+ 2 - 0
Makefile

@@ -6,6 +6,8 @@ else ifeq ($(shell uname), OS/2)
6 6
     include Makefile.os2
7 7
 else ifeq ($(shell uname), FreeBSD)
8 8
     include Makefile.bsd
9
+else ifeq ($(shell uname), OpenBSD)
10
+    include Makefile.bsd
9 11
 else
10 12
     include Makefile.linux
11 13
 endif

+ 3 - 1
Makefile.bsd

@@ -29,7 +29,9 @@ OPTFLAGS=-O2
29 29
 bench: OPTFLAGS=-O3 $(BENCH_ARCH_OPTION)
30 30
 CFLAGS+=$(OPTFLAGS)
31 31
 
32
-LIBS+=-lrt
32
+ifneq ($(shell uname), OpenBSD)
33
+    LIBS+=-lrt
34
+endif
33 35
 SRCDIR=src
34 36
 TESTDIR=tests
35 37
 LIB_OBJS=bitstring.o encparams.o hash.o idxgen.o key.o mgf.o ntru.o poly.o rand.o arith.o sha1.o sha2.o

+ 2 - 1
README.md

@@ -18,6 +18,7 @@ page at https://tbuktu.github.com/ntru/.
18 18
 ## Compiling
19 19
 
20 20
 Run ```make``` to build the library, or ```make test``` to run unit tests. ```make bench``` builds a benchmark program.
21
+On *BSD, use ```gmake``` instead of ```make```.
21 22
 
22 23
 The ```SSE``` environment variable enables SSSE3 support (```SSE=yes```)
23 24
 or disables it (```SSE=no```).
@@ -79,7 +80,7 @@ For encryption of messages longer than `ntru_max_msg_len(...)`, see `src/hybrid.
79 80
 (requires OpenSSL lib+headers, use `make hybrid` to build).
80 81
 
81 82
 ## Supported Platforms
82
-  libntru has been tested on Linux, FreeBSD (using gmake), Mac OS X and Windows (MingW).
83
+  libntru has been tested on Linux, FreeBSD, OpenBSD, Mac OS X, and Windows (MingW).
83 84
 
84 85
 ## Further reading
85 86