Skip to content

Commit

Permalink
Detect glibc to decide whether to link against argp-standalone
Browse files Browse the repository at this point in the history
  • Loading branch information
hack3ric committed Jul 25, 2024
1 parent 2e27930 commit 8d697ec
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ mimic_src := $(wildcard src/*.c)
mimic_obj := $(mimic_src:.c=.o)
mimic_headers := src/bpf_skel.h $(wildcard src/*.h) $(mimic_common_headers)
mimic_link_libs := -lbpf -lffi
ifneq ($(ARGP_STANDALONE),)

ifeq ($(filter "gnu libc" "glibc" "free software foundation",$(shell ldd --version 2>&1 | tr '[A-Z]' '[a-z]')),)
mimic_link_libs += -largp
endif

ifneq ($(STATIC),)
mimic_link_libs += -lelf -lzstd -lz
LDFLAGS += -static
Expand Down

0 comments on commit 8d697ec

Please sign in to comment.