Skip to content

Commit 780e536

Browse files
committed
use autoconf to crete build scripts depending on landlock presence (fix #417)
1 parent ed0ab12 commit 780e536

File tree

6 files changed

+4500
-11
lines changed

6 files changed

+4500
-11
lines changed

ChangeLog

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ vNEXT:
44

55
Reintroduced --ssl as an alias to --tls.
66

7+
Introduce autoconf to adapt to landlock presence.
8+
79
v2.0.1:
810
Fix resolve_on_forward setting, which would crash
911
sslh reliably.

Makefile renamed to Makefile.in

+4-7
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ VERSION=$(shell ./genver.sh -r)
33

44
# Configuration -- you probably need to `make clean` if you
55
# change any of these
6+
# landlock is checked by `configure` and set in config.h
67
ENABLE_SANITIZER= # Enable ASAN/LSAN/UBSAN
78
ENABLE_REGEX=1 # Enable regex probes
89
USELIBCONFIG=1 # Use libconfig? (necessary to use configuration files)
910
USELIBEV=1 # Use libev?
1011
USELIBWRAP?= # Use libwrap?
1112
USELIBCAP= # Use libcap?
12-
USELANDLOCK=1 # Use the landlock LSM?
1313
USESYSTEMD= # Make use of systemd socket activation
1414
USELIBBSD?= # Use libbsd (needed to update process name in `ps`)
1515
COV_TEST= # Perform test coverage?
@@ -78,12 +78,6 @@ ifneq ($(strip $(USELIBEV)),)
7878
CONDITIONAL_TARGETS+=sslh-ev
7979
endif
8080

81-
ifneq ($(strip $(USELANDLOCK)),)
82-
CPPFLAGS+=-DLANDLOCK
83-
endif
84-
85-
86-
8781
all: sslh-fork sslh-select $(MAN) echosrv $(CONDITIONAL_TARGETS)
8882

8983
%.o: %.c %.h version.h
@@ -123,6 +117,9 @@ echosrv-conf.c echosrv-conf.h: echosrv.cfg
123117
echosrv: version.h echosrv-conf.c echosrv.o echosrv-conf.o argtable3.o
124118
$(CC) $(CFLAGS) $(LDFLAGS) -o echosrv echosrv.o echosrv-conf.o argtable3.o $(LIBS)
125119

120+
121+
landlock.o: config.h
122+
126123
$(MAN): sslh.pod Makefile
127124
pod2man --section=8 --release=$(VERSION) --center=" " sslh.pod | gzip -9 - > $(MAN)
128125

config.h.in

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
3+
#ifndef CONFIG_H
4+
/* Template for config.h, filled by `configure`. */
5+
6+
/* Landlock sandboxing Linux LSM */
7+
#undef HAVE_LANDLOCK
8+
9+
#endif

0 commit comments

Comments
 (0)