Skip to content

Commit

Permalink
Makefile: add USE_LIBBROTLI to opt in linking libbrotli
Browse files Browse the repository at this point in the history
note: this is a breaking change on the Makefile :
if you need to support brotli in your builds, you now need to add
    USE_LIBBROTLI=1
in your build environment.

e.g: change:
    make link_brotli
    make pg_build

to one of:
    USE_LIBBROTLI=1 make link_brotli
    USE_LIBBROTLI=1 make pg_build

or:
    export USE_LIBBROTLI=1
    make link_brotli
    make pg_build
  • Loading branch information
LeGEC committed Nov 16, 2022
1 parent 6379baf commit e6bcc48
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ GOLANGCI_LINT_VERSION ?= "v1.37.0"
REDIS_VERSION ?= "5.0.8"
TOOLS_MOD_DIR := ./internal/tools

BUILD_TAGS:=brotli
BUILD_TAGS:=

ifdef USE_LIBBROTLI
BUILD_TAGS:=$(BUILD_TAGS) brotli
endif

ifdef USE_LIBSODIUM
BUILD_TAGS:=$(BUILD_TAGS) libsodium
Expand Down Expand Up @@ -233,7 +237,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 [ -n "${USE_LIBBROTLI}" ]; then ./link_brotli.sh; fi
@if [ -z "${USE_LIBBROTLI}" ]; then echo "info: USE_LIBBROTLI is not set, skipping 'link_brotli' task"; fi

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

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

unlink_libsodium:
Expand Down

0 comments on commit e6bcc48

Please sign in to comment.