Skip to content

Commit

Permalink
Makefile: add an option to opt out of libbrotli
Browse files Browse the repository at this point in the history
  • Loading branch information
LeGEC committed Nov 11, 2022
1 parent 6379baf commit f4ea154
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,15 @@ GOLANGCI_LINT_VERSION ?= "v1.37.0"
REDIS_VERSION ?= "5.0.8"
TOOLS_MOD_DIR := ./internal/tools

BUILD_TAGS:=brotli
BUILD_TAGS:=

# the original Makefile had brotli alwas included
# for this historical reason:
# - brotli is an *opt-out* feature (included by default, use NO_LIBBROTLI to *not* include it),
# - the other libs are opt-in features (not included by default, use USE_LIBSODIUM or USE_LZO to include them)
ifndef NO_LIBBROTLI
BUILD_TAGS:=brotli
endif

ifdef USE_LIBSODIUM
BUILD_TAGS:=$(BUILD_TAGS) libsodium
Expand Down Expand Up @@ -233,7 +241,8 @@ install:
@echo "Nothing to be done. Use pg_install/mysql_install/mongo_install/fdb_install/gp_install... instead."

link_brotli:
./link_brotli.sh
@if [ -z "${NO_LIBBROTLI}" ]; then ./link_brotli.sh; fi
@if [ -n "${NO_LIBBROTLI}" ]; then echo "info: NO_LIBBROTLI is set, skipping link_brotli job"; fi

link_libsodium:
@if [ ! -z "${USE_LIBSODIUM}" ]; then\
Expand All @@ -242,7 +251,7 @@ link_libsodium:

unlink_brotli:
rm -rf vendor/github.com/google/brotli/*
mv tmp/brotli/* vendor/github.com/google/brotli/
if [ -z "${NO_LIBBROTLI}" ]; then mv tmp/brotli/* vendor/github.com/google/brotli/; fi
rm -rf tmp/brotli

unlink_libsodium:
Expand Down

0 comments on commit f4ea154

Please sign in to comment.