/
patch-Makefile
36 lines (30 loc) · 964 Bytes
/
patch-Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Patch contains 2 changes:
- enable readline on FreeBSD (upstream never accepted this PR)
- use -O3 on FreeBSD
--- Makefile.orig 2021-04-13 02:22:04 UTC
+++ Makefile
@@ -17,7 +17,8 @@ endif
# Compiler flags for various configurations:
-CFLAGS := -std=c99 -pedantic -Wall -Wextra -Wno-unused-parameter
+# change to c11 on FreeBSD because FreeBSD headers induce c11 through isnan(3), etc.
+CFLAGS := -std=c11 -pedantic -Wall -Wextra -Wno-unused-parameter
ifeq "$(CC)" "clang"
CFLAGS += -Wunreachable-code
@@ -27,13 +28,18 @@ ifeq "$(shell uname)" "Linux"
HAVE_READLINE := yes
endif
+ifeq "$(shell uname)" "FreeBSD"
+ HAVE_READLINE := yes
+ CFLAGS += -I$(prefix)/include
+endif
+
ifeq "$(build)" "debug"
CFLAGS += -g
else ifeq "$(build)" "sanitize"
CFLAGS += -pipe -g -fsanitize=address -fno-omit-frame-pointer
LDFLAGS += -fsanitize=address
else ifeq "$(build)" "release"
- CFLAGS += -O2
+ CFLAGS += -O3
LDFLAGS += -Wl,-s
endif