This commit is contained in:
pepe 2023-04-12 21:51:12 +00:00
parent 82f566f6f5
commit 343cf42ba8
5 changed files with 5 additions and 155 deletions

View File

@ -1,15 +1,6 @@
all: deps haproxy all: deps haproxy
deps: deps/lua deps/pcre2 deps/quictls deps/vtest deps: deps/vtest
deps/lua:
$(MAKE) -C "deps/lua"
deps/pcre2:
$(MAKE) -C "deps/pcre2"
deps/quictls:
$(MAKE) -C "deps/quictls"
deps/vtest: deps/vtest:
$(MAKE) -C "deps/vtest" $(MAKE) -C "deps/vtest"
@ -18,9 +9,6 @@ haproxy:
$(MAKE) -C "haproxy" $(MAKE) -C "haproxy"
clean: clean:
$(MAKE) -C "deps/lua" clean
$(MAKE) -C "deps/pcre2" clean
$(MAKE) -C "deps/quictls" clean
$(MAKE) -C "deps/vtest" clean $(MAKE) -C "deps/vtest" clean
$(MAKE) -C "haproxy" clean $(MAKE) -C "haproxy" clean

42
deps/lua/Makefile vendored
View File

@ -1,42 +0,0 @@
LUA_VERSION = 5.4.4
LUA_SOURCES = https://www.lua.org/ftp/lua-$(LUA_VERSION).tar.gz
LUA_TARBALL = lua-$(LUA_VERSION).tar.gz
LUA_BUILDIR = src
LUA_DESTDIR = dist
LUA_DESTDIR_ABS = $(shell realpath $(LUA_DESTDIR))
LUA_ARCHIVE = lua-dist.tar.gz
all: build $(LUA_DESTDIR) $(LUA_ARCHIVE)
$(LUA_TARBALL):
xbps-fetch -o "$(LUA_TARBALL)" "$(LUA_SOURCES)"
$(LUA_BUILDIR): $(LUA_TARBALL)
@if ! [ -d "$(LUA_BUILDIR)" ]; then mkdir -v "$(LUA_BUILDIR)"; fi
tar -C $(LUA_BUILDIR) --strip-components=1 -xf "$(LUA_TARBALL)"
build: $(LUA_BUILDIR)
$(MAKE) build_$(shell uname -s)
.PHONY: build_Linux
build_Linux:
$(MAKE) -C $(LUA_BUILDIR) -j$(shell nproc) linux
.PHONY: build_Darwin
build_Darwin:
$(MAKE) -C $(LUA_BUILDIR) -j$(shell nproc) macosx
$(LUA_DESTDIR): build
if ! [ -d "$(LUA_DESTDIR)" ]; then mkdir -v "$(LUA_DESTDIR)"; fi
$(MAKE) -C $(LUA_BUILDIR) -j$(shell nproc) install INSTALL_TOP="$(LUA_DESTDIR_ABS)"
$(LUA_ARCHIVE): $(LUA_DESTDIR)
tar -C "$(LUA_DESTDIR)" -cjf "$(LUA_ARCHIVE)" $$(ls -1 $(LUA_DESTDIR))
clean:
rm -fv "$(LUA_TARBALL)"
rm -rf "$(LUA_BUILDIR)"
rm -rf "$(LUA_DESTDIR)"
rm -fv "$(LUA_ARCHIVE)"
.PHONY: clean build

35
deps/pcre2/Makefile vendored
View File

@ -1,35 +0,0 @@
PCRE2_VERSION = 10.40
PCRE2_SOURCES = https://github.com/PCRE2Project/pcre2/releases/download/pcre2-$(PCRE2_VERSION)/pcre2-$(PCRE2_VERSION).tar.gz
PCRE2_TARBALL = pcre2-$(PCRE2_VERSION).tar.gz
PCRE2_BUILDIR = src
PCRE2_DESTDIR = dist
PCRE2_DESTDIR_ABS = $(shell realpath $(PCRE2_DESTDIR))
PCRE2_ARCHIVE = pcre2-dist.tar.gz
all: build $(PCRE2_DESTDIR) $(PCRE2_ARCHIVE)
$(PCRE2_TARBALL):
xbps-fetch -o "$(PCRE2_TARBALL)" "$(PCRE2_SOURCES)"
$(PCRE2_BUILDIR): $(PCRE2_TARBALL)
@if ! [ -d "$(PCRE2_BUILDIR)" ]; then mkdir -v "$(PCRE2_BUILDIR)"; fi
tar -C $(PCRE2_BUILDIR) --strip-components=1 -xf "$(PCRE2_TARBALL)"
build: $(PCRE2_BUILDIR)
if [ -f "$(PCRE2_BUILDIR)/CmakeCache.txt" ]; then rm -v "$(PCRE2_BUILDIR)/CmakeCache.txt"; fi
cd "$(PCRE2_BUILDIR)" && cmake -DPCRE2_STATIC_PIC=ON -DPCRE2_SUPPORT_JIT=ON -DCMAKE_INSTALL_PREFIX="$(PCRE2_DESTDIR_ABS)" . && make
$(PCRE2_DESTDIR): build
if ! [ -d "$(PCRE2_DESTDIR)" ]; then mkdir -v "$(PCRE2_DESTDIR)"; fi
cd "$(PCRE2_BUILDIR)" && make install
$(PCRE2_ARCHIVE): $(PCRE2_DESTDIR)
tar -C "$(PCRE2_DESTDIR)" -cjf "$(PCRE2_ARCHIVE)" $$(ls -1 $(PCRE2_DESTDIR))
clean:
rm -fv "$(PCRE2_TARBALL)"
rm -rf "$(PCRE2_BUILDIR)"
rm -rf "$(PCRE2_DESTDIR)"
rm -fv "$(PCRE2_ARCHIVE)"
.PHONY: clean build

51
deps/quictls/Makefile vendored
View File

@ -1,51 +0,0 @@
OPENSSL_VERSION = 1.1.1t
BUILD_VERSION_REPOSHA = $(shell git rev-parse --short HEAD)
QUICTLS_TAG = OpenSSL_$(subst .,_,$(OPENSSL_VERSION))-quic1
QUICTLS_SOURCES = https://codeload.github.com/quictls/openssl/tar.gz/$(QUICTLS_TAG)
QUICTLS_TARBALL = quictls-$(OPENSSL_VERSION).tar.gz
QUICTLS_BUILDIR = src
QUICTLS_DESTDIR = dist
QUICTLS_DESTDIR_ABS = $(shell realpath $(QUICTLS_DESTDIR))
QUICTLS_ARCHIVE = quictls-dist.tar.gz
all: build $(QUICTLS_DESTDIR) $(QUICTLS_ARCHIVE)
$(QUICTLS_TARBALL):
xbps-fetch -o "$(QUICTLS_TARBALL)" "$(QUICTLS_SOURCES)"
$(QUICTLS_BUILDIR): $(QUICTLS_TARBALL)
@if ! [ -d "$(QUICTLS_BUILDIR)" ]; then mkdir -v "$(QUICTLS_BUILDIR)"; fi
tar -C $(QUICTLS_BUILDIR) --strip-components=1 -xf "$(QUICTLS_TARBALL)"
build: $(QUICTLS_BUILDIR)
cd "$(QUICTLS_BUILDIR)" && CC=cc ./config --prefix="/opt/quictls" --openssldir="/opt/quictls" --libdir="lib" no-shared
$(MAKE) -C "$(QUICTLS_BUILDIR)" -j "$(shell nproc)"
"$(QUICTLS_BUILDIR)/apps/openssl" version
$(MAKE) buildinfo_$(shell uname -s)
.PHONY: buildinfo_Linux
buildinfo_Linux:
@echo "Checking shared libraries openssl is linked against (Linux):"
@ldd "$(QUICTLS_BUILDIR)/apps/openssl" || true
.PHONY: buildinfo_Darwin
buildinfo_Darwin:
@echo "Checking shared libraries openssl is linked against (Darwin):"
@otool -L "$(QUICTLS_BUILDIR)/apps/openssl" || true
$(QUICTLS_DESTDIR): build
@if ! [ -d "$(QUICTLS_DESTDIR)" ]; then mkdir -v "$(QUICTLS_DESTDIR)"; fi
$(MAKE) -C "$(QUICTLS_BUILDIR)" -j "$(shell nproc)" DESTDIR="$(QUICTLS_DESTDIR_ABS)" install_sw
$(QUICTLS_DESTDIR_ABS)/opt/quictls/bin/openssl version
$(QUICTLS_ARCHIVE): $(QUICTLS_DESTDIR)
tar -C "$(QUICTLS_DESTDIR)" --owner=root:0 --group=root:0 -czf "$(QUICTLS_ARCHIVE)" "opt"
clean:
rm -fv "$(QUICTLS_TARBALL)"
rm -rf "$(QUICTLS_BUILDIR)"
rm -rf "$(QUICTLS_DESTDIR)"
rm -fv "$(QUICTLS_ARCHIVE)"
.PHONY: clean build

View File

@ -12,9 +12,6 @@ HAPROXY_DESTDIR = dist
HAPROXY_DESTDIR_ABS = $(shell realpath $(HAPROXY_DESTDIR)) HAPROXY_DESTDIR_ABS = $(shell realpath $(HAPROXY_DESTDIR))
HAPROXY_ARCHIVE = haproxy-dist.tar.gz HAPROXY_ARCHIVE = haproxy-dist.tar.gz
DEP_DIST_ROOT_LUA = $(shell realpath ../deps/lua/dist)
DEP_DIST_ROOT_PCRE2 = $(shell realpath ../deps/pcre2/dist)
DEP_DIST_ROOT_QUICTLS = $(shell realpath ../deps/quictls/dist)
DEP_DIST_ROOT_VTEST = $(shell realpath ../deps/vtest/dist) DEP_DIST_ROOT_VTEST = $(shell realpath ../deps/vtest/dist)
BUILD_VERSION_REPOSHA = $(shell git rev-parse --short HEAD) BUILD_VERSION_REPOSHA = $(shell git rev-parse --short HEAD)
@ -33,26 +30,19 @@ MAKEARGS = DEBUG="-DDEBUG_MEMORY_POOLS -DDEBUG_STRICT" \
VERDATE="$(shell date -u -I'minutes')" \ VERDATE="$(shell date -u -I'minutes')" \
USE_LIBCRYPT=1 \ USE_LIBCRYPT=1 \
USE_LUA=1 \ USE_LUA=1 \
LUA_INC="$(DEP_DIST_ROOT_LUA)/include" \ LUA_LIB_NAME="lua5.4" \
LUA_LIB="$(DEP_DIST_ROOT_LUA)/lib" \
LUA_LIB_NAME="lua" \
USE_OPENSSL=1 \ USE_OPENSSL=1 \
SSL_INC="$(DEP_DIST_ROOT_QUICTLS)/opt/quictls/include" \ SSL_INC="/usr/local/include" \
SSL_LIB="$(DEP_DIST_ROOT_QUICTLS)/opt/quictls/lib" \ SSL_LIB="/usr/local/lib" \
USE_PCRE2=1 \ USE_PCRE2=1 \
USE_PROMEX=1 \
USE_QUIC=1 \ USE_QUIC=1 \
USE_SLZ=1 \ USE_SLZ=1 \
USE_TFO=1 USE_TFO=1
MAKEARGS_LINUX = $(MAKEARGS) \ MAKEARGS_LINUX = $(MAKEARGS) \
PCRE2_LIB="$(DEP_DIST_ROOT_PCRE2)/lib64" \
PCRE2_INC="$(DEP_DIST_ROOT_PCRE2)/include" \
PCRE2_CONFIG="$(DEP_DIST_ROOT_PCRE2)/bin/pcre2-config" \
USE_PCRE2_JIT=1 \ USE_PCRE2_JIT=1 \
USE_STATIC_PCRE2=1 \
USE_NS=1 \ USE_NS=1 \
SBINDIR=/usr/local/bin SBINDIR=/usr/local/bin \
TARGET=linux-glibc TARGET=linux-glibc
MAKEARGS_DARWIN = $(MAKEARGS) \ MAKEARGS_DARWIN = $(MAKEARGS) \