Skip to content

Commit

Permalink
Makefile: Only set PROMTAIL_CGO if CGO_ENABLED is not 0. (#3935)
Browse files Browse the repository at this point in the history
* Only set PROMTAIL_CGO if CGO_ENABLED is not 0.

This allows to build promtail without journald support on linux distributions that don't have systemd.

Run as
CGO_ENABLED=0 make promtail

* Fix scope.
  • Loading branch information
ecraven authored Jul 5, 2021
1 parent 0403e9d commit 1fb06cc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ PROMTAIL_DEBUG_GO_FLAGS := $(DEBUG_GO_FLAGS)
# Validate GOHOSTOS=linux && GOOS=linux to use CGO.
ifeq ($(shell go env GOHOSTOS),linux)
ifeq ($(shell go env GOOS),linux)
ifneq ($(CGO_ENABLED), 0)
PROMTAIL_CGO = 1
endif
PROMTAIL_GO_FLAGS = $(DYN_GO_FLAGS)
PROMTAIL_DEBUG_GO_FLAGS = $(DYN_DEBUG_GO_FLAGS)
endif
Expand Down

0 comments on commit 1fb06cc

Please sign in to comment.