-
Notifications
You must be signed in to change notification settings - Fork 4
/
socat.mak
47 lines (41 loc) · 1.5 KB
/
socat.mak
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
37
38
39
40
41
42
43
44
45
46
47
NAME := socat
SOCAT_VERSION := 1.7.4.3
SOCAT_URL := http://www.dest-unreach.org/socat/download/socat-$(SOCAT_VERSION).tar.gz
SOCAT_PROGRAMS := socat procan filan
SOCAT_LIBRARIES :=
# NOTE: yes, that's an insecure HTTP download URL.
# The HTTPS version provides a certificate for the wrong domain,
# so we'd have to turn off certificate verification anyways.
# There's also a git repo, but it's hosted on a different 3rd domain.
# Enabling OpenSSL makes socat 10x larger.
SOCAT_CONFIG = --disable-openssl --disable-readline
$(eval $(call create_recipes, \
$(NAME), \
$(SOCAT_VERSION), \
$(SOCAT_URL), \
$(SOCAT_PROGRAMS), \
$(SOCAT_LIBRARIES), \
))
# NOTE: without `-Werror-implicit-function-declaration` during configure,
# configure incorrectly detects that getprotobynumber_r is available
# even though the compilation threw an "implicit declaration" warning.
$(BUILD_FLAG):
$(eval $(call activate_toolchain,$@))
cd "$(SRC)" && ./configure \
$(CONFIGURE_DEFAULTS) \
$(SOCAT_CONFIG) \
CFLAGS="$(CFLAGS) -Werror-implicit-function-declaration" \
LDFLAGS="$(LDFLAGS)"
$(MAKE) -C "$(SRC)" clean
$(MAKE) -C "$(SRC)"
$(MAKE) -C "$(SRC)" install
# If not explicitly disabled, socat prefers having OpenSSL.
ifeq (,$(findstring disable-openssl,$(SOCAT_CONFIG)))
$(BUILD_FLAG): $$(libssl) $$(libcrypto)
endif
# If not explicitly disabled, socat prefers having readline.
ifeq (,$(findstring disable-readline,$(SOCAT_CONFIG)))
$(BUILD_FLAG): $$(libreadline)
endif
ALL_PROGRAMS += $(SOCAT_PROGRAMS)
DEFAULT_PROGRAMS += socat