From 752ab983d1dd947a1ffcd7cd3567ec5624044c06 Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Wed, 9 Jun 2021 09:12:57 +0900 Subject: [PATCH] make: -fPIC static libs that link to shared libs --- GNUmakefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/GNUmakefile b/GNUmakefile index 70f8577..568cbb9 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -56,6 +56,7 @@ $(renderers): %: VERSION .git/index | $(libs) $(bins): %: | $(libs) $(LINK.c) $(filter %.c %.a,$^) $(LDLIBS) -L. -lbemenu -o $@ +cdl.a: private override LDFLAGS += -fPIC cdl.a: lib/3rdparty/cdl.c lib/3rdparty/cdl.h libbemenu.so: private override LDLIBS += -ldl @@ -84,10 +85,13 @@ lib/renderers/wayland/xdg-output-unstable-v1.h: lib/renderers/wayland/xdg-output lib/renderers/wayland/xdg-output-unstable-v1.c: lib/renderers/wayland/xdg-output-unstable-v1.xml wayland-scanner private-code < $^ > $@ +xdg-shell.a: private override LDFLAGS += -fPIC xdg-shell.a: private override CPPFLAGS += $(shell pkg-config --cflags-only-I wayland-client) xdg-shell.a: lib/renderers/wayland/xdg-shell.c +wlr-layer-shell.a: private override LDFLAGS += -fPIC wlr-layer-shell.a: private override CPPFLAGS += $(shell pkg-config --cflags-only-I wayland-client) wlr-layer-shell.a: lib/renderers/wayland/wlr-layer-shell-unstable-v1.c lib/renderers/wayland/wlr-layer-shell-unstable-v1.h +xdg-output.a: private override LDFLAGS += -fPIC xdg-output.a: private override CPPFLAGS += $(shell pkg-config --cflags-only-I wayland-client) xdg-output.a: lib/renderers/wayland/xdg-output-unstable-v1.c lib/renderers/wayland/xdg-output-unstable-v1.h bemenu-renderer-wayland.so: private override LDLIBS += $(shell pkg-config --libs wayland-client cairo pango pangocairo xkbcommon)